Threading / Queue management

Aahz aahz at pythoncraft.com
Mon Feb 9 18:10:04 CET 2009


In article <a852a388-2e3f-4b45-aa80-695fc116ecfc at v18g2000pro.googlegroups.com>,
Power Button  <mjbuchan at gmail.com> wrote:
>
>I wonder if anyone can help with the following. I have written a
>script which polls a server and if it finds and pending orders, it
>instantiates an new object (foo) - in a new thread and processes some
>data. In the new object (foo), there are also some long running
>processes so I am trying to create a thread pool/queue and to push
>items onto the queue in the instantiated object (foo). Currently I am
>creating the Queue in foo but this means I am starting up 5 new
>threads every time I instantiate foo. What I want to be able to do is
>create the Queue and start 5 (n) threads when my program starts and
>then push items onto the queue in foo.

Not sure what you're trying to do, but you meay find this sample code
useful:

http://www.pythoncraft.com/OSCON2001/index.html
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.



More information about the Python-list mailing list