Davin Potts added the comment:

On Windows, because that OS does not support fork, multiprocessing uses spawn 
to create new processes by default.  Note that in Python 3, multiprocessing 
provides the user with a choice of how to create new processes (i.e. fork, 
spawn, forkserver).

When fork is used, the 'q = Queue()' in this example would be executed once by 
the parent process before the fork takes place, the resulting child process 
continues execution from the same point as the parent when it triggered the 
fork, and thus both parent and child processes would see the same 
multiprocessing.Queue.  When spawn is used, a new process is spawned and the 
whole of this example script would be executed again from scratch by the child 
process, resulting in the child (spawned) process creating a new Queue object 
of its own with no sense of connection to the parent.


Would you be up for proposing replacement text to improve the documentation?  
Getting the documentation just right so that everyone understands it is worth 
spending time on.

----------
nosy: +davin
stage:  -> needs patch
type: behavior -> enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to