[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Multiprocessing problem

Matt Chaput

3/3/2010 1:08:00 AM

> If the main process doesn't get the results from the queue until the
> worker processes terminate, and the worker processes don't terminate
> until they've put their results in the queue, and the pipe consequently
> fills up, then deadlock can result.

The queue never fills up... on platforms with qsize() I can see this. I
remove items from the results queue as I add to the job queue, and if I
add timeouts everywhere the workers never raise Empty and the supervisor
never raises Full. They just deadlock.

I've rewritten the code so the worker threads don't push information
back while they run, they just write to a temporary file which the
supervisor can read, which avoids the issue. But if anyone can tell me
what I was doing wrong for future reference, I'd greatly appreciate it.

Thanks,

Matt