18 Apr
2020
18 Apr
'20
5:22 p.m.
On Sat, 18 Apr 2020 19:02:47 +0200
Antoine Pitrou
* I do think a minimal synchronization primitive would be nice. Either a Lock (in the Python sense) or a Semaphore: both should be relatively easy to provide, by wrapping an OS-level synchronization primitive. Then you can recreate all high-level synchronization primitives, like the threading and multiprocessing modules do (using a Lock or a Semaphore, respectively).
By the way, perhaps this could be even be implemented as making _threading.Lock shareable. This would probably require some changes in the underlying C Lock structure (e.g. pointing to an atomically-refcounted shared control block), but nothing intractable, and reasonably efficient. Regards Antoine.