Currently, C++ has support for atomic types, on which operations like add, sub, 
xor, etc can be done atomically, thereby avoiding data races.
Having such a support will be very helpful in Python.

For instance users won't have to use Locks for synchronising shared variables 
in case of multiprocessing. And, directly passing these atomic objects would be 
enough. These objects can have methods such as add, sub, etc to change the 
underlying variable.

I believe this would make python much more easier for users in both trivial and 
complicated cases, without having to use lock.

gcc also provides inbuilt support for some atomic operations. Documentation for 
the same is available at 
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins

Moreover, gcc also has support for Memory Model aware atomic operations 
documented at 
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/S4EV6IJCCZZSTGN7UVTXEU7UNGHNIBRC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to