Re: reloading code and multiprocessing

2012-07-27 Thread andrea crotti
2012/7/25 andrea crotti : > > I would also like to avoid this in general, but we have many > subprocesses to launch and some of them might take weeks, so we need > to have a process which is always running, because there is never a > point in time where we can just say let's stop everything and sta

Re: reloading code and multiprocessing

2012-07-25 Thread andrea crotti
2012/7/23 Chris Angelico : > > That would probably be correct. However, I still think you may be > fighting against the language instead of playing to its strengths. > > I've never fiddled with sys.modules like that, but I know some have, > without problem. > > ChrisA > -- > http://mail.python.org/

Re: reloading code and multiprocessing

2012-07-23 Thread Chris Angelico
On Mon, Jul 23, 2012 at 11:51 PM, andrea crotti wrote: > Anyway the only other problem which I found is that if I start the > subprocesses after many other things are initialised, it might happen > that the reloading doesn't work correctly, is that right? > > Because sys.modules will get inherited

Re: reloading code and multiprocessing

2012-07-23 Thread andrea crotti
2012/7/20 Chris Angelico : > On Thu, Jul 19, 2012 at 8:15 PM, andrea crotti > wrote: >> We need to be able to reload code on a live system. This live system >> has a daemon process always running but it runs many subprocesses with >> multiprocessing, and the subprocesses might have a short life..

Re: reloading code and multiprocessing

2012-07-20 Thread Chris Angelico
On Thu, Jul 19, 2012 at 8:15 PM, andrea crotti wrote: > We need to be able to reload code on a live system. This live system > has a daemon process always running but it runs many subprocesses with > multiprocessing, and the subprocesses might have a short life... > ... > As long as I import the

Re: reloading code and multiprocessing

2012-07-19 Thread 88888 Dihedral
andrea crotti於 2012年7月19日星期四UTC+8下午6時15分11秒寫道: > We need to be able to reload code on a live system. This live system > has a daemon process always running but it runs many subprocesses with > multiprocessing, and the subprocesses might have a short life... > > Now I found a way to reload the cod

reloading code and multiprocessing

2012-07-19 Thread andrea crotti
We need to be able to reload code on a live system. This live system has a daemon process always running but it runs many subprocesses with multiprocessing, and the subprocesses might have a short life... Now I found a way to reload the code successfully, as you can see from this testcase: def