All synchronization primitives are available from threading and multiprocessing modules. A primitive from threading module synchronizes between threads from the same process. A primitive from multiprocessing module synchronizes between threads across multiples processes and is heavier.
Primitives:
LockRLock(Reentrant or recursive lock)SemaphoreBoundedSemaphore(raisesValueErrorif more releases than acquires)EventCondition(Event + Lock)Barrier
Leave a comment