Mutex vs Threading locks. What to use?

My main question is, is Threading locking object creating atomic locking? He does not say that locking is atomic in module documentation. in the pythons mutex documentation, he says that locking a mutex is atomic, but it seems like I read somewhere that this is actually not the case. I am wondering if anyone could give me a little understanding of this mattress. Which lock should I use. I am currently running my scripts using python 2.4

+7
python multithreading locking mutex
source share
1 answer

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).

+13
source share

All Articles