Threading Pool Event()

Aahz aahz at pythoncraft.com
Fri Jul 18 09:09:25 EDT 2003


In article <0tRRa.212$vD1.8077 at nnrp1.ozemail.com.au>,
Graeme Matthew <gsmatthew at ozemail.com.au> wrote:
>
>I just cannot seem to find any documentation that shows an example of
>using the factory method Event() in threads. I have a thread pool and
>if there are no jobs in a Queue I want them to wait for something to
>be inserted. When a job is inserted I want to send an Event, the first
>thread that picks it up runs with the job the rest wait for another
>insert Event.

Given that you're already using a Queue, there is no, repeat NO, reason
for using an Event.  Just have your threads block on the Queue.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

A: No.
Q: Is top-posting okay?




More information about the Python-list mailing list