classification
Title: multiprocessing package incompatible with PyObjC
Type: behavior Stage: resolved
Components: macOS Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: multiprocessing needs option to eschew fork() under Linux
View: 8713
Assigned To: ronaldoussoren Nosy List: mrmekon, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2011-12-08 20:26 by mrmekon, last changed 2012-01-04 03:34 by ned.deily. This issue is now closed.

Files
File name Uploaded Description Edit
threadtest3.py mrmekon, 2011-12-08 20:26 Example of multiprocessing failing with PyObjC
Messages (3)
msg149051 - (view) Author: Trevor Bentley (mrmekon) Date: 2011-12-08 20:26
The multiprocessing package appears to spawn a new process by calling only fork().  Apple's CoreFoundation libraries (and possibly more, I do not know the full extent) *require* new processes to be spawned with the full fork()+exec*() combo.

When using PyObjC to access native Mac libraries, Python's multithreading library is not usable.  The error thrown is:

------------------------
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
------------------------

Test code: https://gist.github.com/1448398
msg149053 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-12-08 21:06
(Reference original discussion in pyobjc-dev mailing list archived here:  http://comments.gmane.org/gmane.comp.python.pyobjc.devel/5965)
msg150580 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2012-01-04 03:34
Issue8713 proposes adding the option of using processes for multiprocessing rather than bare forks.  Let's consolidate this issue with that one.
History
Date User Action Args
2012-01-04 03:34:27ned.deilysetstatus: open -> closed
resolution: duplicate
messages: + msg150580

superseder: multiprocessing needs option to eschew fork() under Linux
stage: resolved
2011-12-08 21:06:26ned.deilysetmessages: + msg149053
2011-12-08 20:43:30pitrousetnosy: + ned.deily

versions: + Python 3.2, Python 3.3
2011-12-08 20:26:13mrmekoncreate