zeroc-ice / ice-demos

Sample programs for Ice
https://zeroc.com
GNU General Public License v2.0
325 stars 217 forks source link

Counter demo on Python #132

Closed laloweb99 closed 3 years ago

laloweb99 commented 3 years ago

Hello! Is it possible to add/do this c++ example on Python? If is it possible how?

pepone commented 3 years ago

Did you check the python IceStorm demo?

laloweb99 commented 3 years ago

yes but it does not use any mutex or Ice::uncheckedCast on it :crying_cat_face:

pepone commented 3 years ago

The Python hello demo shows the use of ucheckedCast

https://github.com/zeroc-ice/ice-demos/blob/7a91b5461d8358753e766bd1b12cd505d1f093f1/python/Ice/hello/client.py#L20-L23

As per mutex usage, this is a C++ standard API not Ice specific, python has its own APIs for this

see for example: https://docs.python.org/3/library/threading.html#lock-objects https://docs.python.org/3/library/threading.html#condition-objects

Some of the demos in https://github.com/zeroc-ice/ice-demos/tree/3.7/python/Ice make use of these python APIs too

laloweb99 commented 3 years ago

Thank you so much gentleman!