This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Martin Ritter
Recipients Martin Ritter, davin, devin, docs@python, r.david.murray, rhettinger, sbt
Date 2016-07-04.13:18:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467638288.54.0.424124907663.issue27422@psf.upfronthosting.co.za>
In-reply-to
Content
I agree that this is error prone and can not be fixed reliably on the python side. However, python makes it very easy to mix these two, a user might not even notice it if a function he calls uses fork and thus just use a ThreadPoolExecutor() because it's the simplest thing to do.

What could be an nice solution in my opinion if the multiprocessing module could check if there are already multiple threads active on process creation and issue a warning if so. This warning could of course be optional but would make this issue more obvious.

In my case we have a large C++ code base which still includes a lot of Fortran 77 code with common blocks all over the place (yay science). Everything is interfaced in python so to make sure that I do not have any side effects I run the some of the functions in a fork using multiprocessing.Process(). And in this case I just wanted to run some testing in parallel. I now switched to a ProcessPoolExecutor which works fine but for me.
History
Date User Action Args
2016-07-04 13:18:08Martin Rittersetrecipients: + Martin Ritter, rhettinger, r.david.murray, docs@python, devin, sbt, davin
2016-07-04 13:18:08Martin Rittersetmessageid: <1467638288.54.0.424124907663.issue27422@psf.upfronthosting.co.za>
2016-07-04 13:18:08Martin Ritterlinkissue27422 messages
2016-07-04 13:18:07Martin Rittercreate