fork() and wait()

Chuck May NmOaSyPcAM at imsweb.com
Wed Oct 16 11:00:36 EDT 2002


That looks like it's more designed to work with threads.  The whole reason 
I went the fork way was bacause Python's threading doesn't seem to use 
multiple CPUs, and the box I'm on has 4.

-- 
Chuck May
IMS, Inc.
NmOaSyPcAM at imsweb.com


"Delaney, Timothy" <tdelaney at avaya.com> wrote in 
news:mailman.1034640742.1283.python-list at python.org:

>> From: Chuck May [mailto:NmOaSyPcAM at imsweb.com]
>> 
>> I am trying to write an application that forks off processes 
>> and waits 
>> for everything to complete before doing other calculations.  The one 
>> catch is that I would like to limit the number of concurrent child 
>> processes.  In other words, let's say I have 10 "jobs" that 
>> need to be 
>> done, but I'd like no more than 4 running at the same time.  Here is 
>> what I cane up with:
> 
> Queue.Queue is your friend.
> 
> Tim Delaney
> 
> 



More information about the Python-list mailing list