multiprocessing module

34 views
Skip to first unread message

kris

unread,
Aug 1, 2012, 1:02:44 PM8/1/12
to pylons-...@googlegroups.com
I was trying to use the multiproccessing  Pool module to do some background processing
after a web request.  Seems to work fine on Linux, but on windows the process
basically ends up trying to restart the entire web server, which fails since the listening port
is occupied, and never ends up calling the requested functions.

The multiprocessing docs emphasize that the "__main__" module be protected
with the usual if __name__ == "__main__", so that it can be loaded without running
all initialization code again.    This seems to be what is happening in the windows
case.  We load a new sub-process which tries to start the web-server all over again.

I poked around the paster code a bit, but couldn't really find the answer. 

Has anybody had any luck using  multiprocessing on BOTH unix and windows in a pylons
project?

Thx,
Kris 
Reply all
Reply to author
Forward
0 new messages