New submission from Brandon Craig Rhodes <bran...@rhodesmill.org>:

The "multiprocessing" module uses a bare fork() to create child processes under 
Linux, so the children get a copy of the entire state of the parent process.  
But under Windows, child processes are freshly spun-up Python interpreters with 
none of the data structures or open connections of the parent process 
available.  This means that code that tests fine under Linux, because it is 
depending on residual parent state in a way that the programmer has not 
noticed, can fail spectacularly under Windows.

Therefore, the "multiprocessing" module should offer an option under Linux that 
ignores the advantage of being able to do a bare fork() and instead spins up a 
new interpreter instance just like Windows does.  Some developers will just use 
this for testing under Linux, so their test results are valid for Windows too; 
and some developers might even use this in production, preferring to give up a 
bit of efficiency under Linux in return for an application that will show the 
same behavior on both platforms.  Either way, an option that lets the developer 
subvert the simple "sys.platform != 'win32'" check in "forking.py" would go a 
long way towards helping us write platform-agnostic Python programs.

----------
components: Library (Lib)
messages: 105719
nosy: brandon-rhodes
priority: normal
severity: normal
status: open
title: multiprocessing needs option to eschew fork() under Linux
type: feature request
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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

Reply via email to