Message72662
The process variable 'p' is leaking into sub-processes when using the
multiprocessing modules. The following code demonstrates the problem:
import sys
from multiprocessing import Process
p = 'Correct'
def test():
print "Got 'p' of", p
if __name__ == '__main__':
if len(sys.argv) == 2 and sys.argv[1] == '-m':
p = Process(target=test)
p.start()
p.join()
else:
test()
Running this in SP and MP mode shows the leakage:
ssmith$ /opt/python-svn/bin/python mpbug.py
Got 'p' of Correct
ssmith$ /opt/python-svn/bin/python mpbug.py -m
Got 'p' of <Process(Process-1, started)>
This occurs in both 2.6b3 and trunk. |
|
Date |
User |
Action |
Args |
2008-09-06 04:53:07 | TarkaSteve | set | recipients:
+ TarkaSteve |
2008-09-06 04:53:06 | TarkaSteve | set | messageid: <1220676786.79.0.371553586642.issue3792@psf.upfronthosting.co.za> |
2008-09-06 04:53:05 | TarkaSteve | link | issue3792 messages |
2008-09-06 04:53:04 | TarkaSteve | create | |
|