Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Well, I get the OP's expected result on windows:

C:\dev\python\trunk>PCbuild\python_d t.py
Got 'p' of Correct
C:\dev\python\trunk>PCbuild\python_d t.py -m
Got 'p' of Correct

This is easy to explain: on Unix, the forked process has a copy of the
memory and reads the last value in the module. 
But on Windows, the freshly spawned process imports the module, and get
the initial value (since it does not enter the "__main__" block).

This is documented:
http://docs.python.org/dev/library/multiprocessing.html#windows , under
"Global Variables".

By the way, the Windows way may have some advantages for some uses.
Could the same method (start a new interpreter, import modules, copy
needed objects), be made available on Unix?

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3792>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to