[Python-Dev] Re: post mortem after threading deadlock?
firstname.lastname@example.org (Skip Montanaro)
Wed, 25 Jul 2001 18:04:11 -0500
Tim> I've got better advice <wink>: Never use semaphores for anything.
Tim> Never use locks except for dirt-simple one- or two-line critical
I didn't find either particularly difficult to work with. Guess I was
fooling myself. ;-)
Guido> I believe that Aahz, in his thread tutorial, has even more
Guido> radical advice: use the Queue module for all inter-thread
Guido> communication. It is even higher level than semaphores, and has
Guido> the same nice properties.
Ah, thanks! I saw the mention of Queues in his slides and thought he was
talking about a queue class that he wrote as an add-on. It never occurred
to me that it would be a core library module. doh! A queue is really what
I want anyway. I'm sharing a limited pool of database connections between a
(potentially large) set of threads.