Author brandon-rhodes
Recipients brandon-rhodes
Date 2010-05-14.16:13:07
SpamBayes Score 8.52106e-06
Marked as misclassified No
Message-id <1273853591.12.0.245920632829.issue8713@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-05-14 16:13:11brandon-rhodessetrecipients: + brandon-rhodes
2010-05-14 16:13:11brandon-rhodessetmessageid: <1273853591.12.0.245920632829.issue8713@psf.upfronthosting.co.za>
2010-05-14 16:13:09brandon-rhodeslinkissue8713 messages
2010-05-14 16:13:07brandon-rhodescreate