Locks of any nature would be useless if they were not atomic - the entire blocking point should provide atomic operations of a higher level.
All streaming synchronization objects (locks, locks, semaphores, bounding cards) use atomic instructions, as well as mutexes.
You should use threading , since mutex actually not recommended in the future (and is removed in Python 3).
Amber
source share