Re: start function in new process

2010-03-06 Thread Martin P. Hellwig
On 03/06/10 09:45, wongjoek...@yahoo.com wrote: Yes, I saw this example also before. HOwever what I want is to call an internal function which gets a reference of another internal function as input and not calling an external program. Do you have any example on that with subprocess module ? Tha

Re: start function in new process

2010-03-06 Thread wongjoek...@yahoo.com
On 5 mrt, 21:40, "Martin P. Hellwig" wrote: > On 03/05/10 20:09, wongjoek...@yahoo.com wrote: > > > > > On 5 mrt, 21:02, "Martin P. Hellwig" > > wrote: > >> On 03/05/10 19:45, wongjoek...@yahoo.com wrote: > > >>> On 5 mrt, 20:40, "Martin P. Hellwig" > >>> wrote: > On 03/05/10 19:21, wongjoek.

Re: start function in new process

2010-03-05 Thread Robert Kern
On 2010-03-05 14:09 PM, wongjoek...@yahoo.com wrote: I can't use multiprocessing module since it comes only with python 2.6 and I am bound to python2.4. It is available as a third party package for Python 2.4: http://pypi.python.org/pypi/multiprocessing -- Robert Kern "I have come to believ

Re: start function in new process

2010-03-05 Thread Martin P. Hellwig
On 03/05/10 20:09, wongjoek...@yahoo.com wrote: On 5 mrt, 21:02, "Martin P. Hellwig" wrote: On 03/05/10 19:45, wongjoek...@yahoo.com wrote: On 5 mrt, 20:40, "Martin P. Hellwig" wrote: On 03/05/10 19:21, wongjoek...@yahoo.com wrote: Any specific reason why threading.Thread or multiprocessin

Re: start function in new process

2010-03-05 Thread Jonathan Gardner
You're really close. See inline comment below. On Fri, Mar 5, 2010 at 11:21 AM, wongjoek...@yahoo.com wrote: > > def c(): >    print "function c" > > def f(a,b, d): >    # function I want to run in a new child process >    print a, b >    d() > > def g(): >    pidID = os.fork() >    if pidID == 0

Re: start function in new process

2010-03-05 Thread wongjoek...@yahoo.com
On 5 mrt, 21:02, "Martin P. Hellwig" wrote: > On 03/05/10 19:45, wongjoek...@yahoo.com wrote: > > > > > On 5 mrt, 20:40, "Martin P. Hellwig" > > wrote: > >> On 03/05/10 19:21, wongjoek...@yahoo.com wrote: > >> > >> Any specific reason why threading.Thread or multiprocessing is not > >> suitable t

Re: start function in new process

2010-03-05 Thread Martin P. Hellwig
On 03/05/10 19:45, wongjoek...@yahoo.com wrote: On 5 mrt, 20:40, "Martin P. Hellwig" wrote: On 03/05/10 19:21, wongjoek...@yahoo.com wrote: Any specific reason why threading.Thread or multiprocessing is not suitable to solve your problem? -- mph Because I got a memory leak in my function f()

Re: start function in new process

2010-03-05 Thread wongjoek...@yahoo.com
On 5 mrt, 20:40, "Martin P. Hellwig" wrote: > On 03/05/10 19:21, wongjoek...@yahoo.com wrote: > > Any specific reason why threading.Thread or multiprocessing is not > suitable to solve your problem? > > -- > mph Because I got a memory leak in my function f(). It uses scipy, numpy, pylab, and I a

Re: start function in new process

2010-03-05 Thread Martin P. Hellwig
On 03/05/10 19:21, wongjoek...@yahoo.com wrote: Any specific reason why threading.Thread or multiprocessing is not suitable to solve your problem? -- mph -- http://mail.python.org/mailman/listinfo/python-list