Semaphore or what should I use?
ville at spammers.com
Thu Dec 2 14:56:49 CET 2004
>>>>> "Sergei" == Sergei Organov <osv at javad.ru> writes:
Sergei> My answer to OP's question is: use either lock (mutex) or
Sergei> semaphore. I'd probably use semaphore as mutexes are
Sergei> usually optimized for the case when contention probability
Sergei> is low (i.e., they usually shouldn't be locked for a long
Both Mutexes and Semaphores put the thread to sleep, so I don't think
there will be a big difference.
The OP might also want to check out read/write lock. The first thing
google finds is
Ville Vainio http://tinyurl.com/2prnb
More information about the Python-list