[Python-ideas] An error in multiprocessing on MacOSX?
Sturla Molden
sturla at molden.no
Wed Nov 21 16:12:04 CET 2012
See this:
http://mail.scipy.org/pipermail/numpy-discussion/2012-August/063593.html
According to Apple enineers:
"""
For API outside of POSIX, including GCD and technologies like
Accelerate, we do not support usage on both sides of a fork(). For
this reason among others, use of fork() without exec is discouraged in
general in processes that use layers above POSIX.
"""
Multiprocessing on OSX calls os.fork, but not os.exec.
Thus, is multiprocessing errorneously implemented on Mac? Forking
without calling exec means that only APIs inside POSIX can be used by
the child process.
For NumPy, it even affects functions like matrix multiplication when the
accelerate framework is used for BLAS.
Does multiprocessing needs a reimplementation on Mac to behave as it
does on Windows? (Yes it would cripple it similarly to the crippled
multiprocessing on Windows.)
And what about Python itself? Is there any non-POSIX code in the
interpreter? If it is, os.fork should be removed on Mac.
Sturla
More information about the Python-ideas
mailing list