[Python-Dev] How to create a child process using multiprocessing in Python2.7.10 without the child sharing resources with parent?

Jigar Bhalodia jigar.1994 at gmail.com
Thu Mar 14 14:39:04 EDT 2019


Hello,

We are trying to move our python 2.7.10 codebase from Windows to Linux. We
recently discovered that multiprocessing library in Python 2.7 behaves
differently on Windows vs Linux. We have found many articles like this one
<https://rhodesmill.org/brandon/2010/python-multiprocessing-linux-windows/>
describing
the problem however, we are unable to find a solution online for Python
2.7. This is a fix
<https://docs.python.org/3/library/multiprocessing.html#multiprocessing.set_start_method>
for
this issue in Python 3.4 however, we are unable to upgrade to Python 3.4.
Is there any way to use multiprocessing in Python 2.7 on Linux without the
child and parent sharing memory? We can also use guidance on modifying
forking.py
<https://github.com/python/cpython/blob/2.7/Lib/multiprocessing/forking.py>
code
in python 2.7 to ensure child and parent process aren't sharing memory and
doing Copy-on-Write. Thanks!

https://stackoverflow.com/questions/55168149/how-to-create-a-child-process-using-multiprocessing-in-python2-7-10-without-the

Thanks,
Jigar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190314/99d09ac9/attachment.html>


More information about the Python-Dev mailing list