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 avian
Recipients Giovanni.Bajo, avian, bobbyi, gregory.p.smith, neologix, nirai, pitrou, sdaoden, vstinner
Date 2011-06-30.15:04:07
SpamBayes Score 1.937479e-10
Marked as misclassified No
Message-id <1309446248.54.0.197690969309.issue6721@psf.upfronthosting.co.za>
In-reply-to
Content
> You mean a runtime warning? That would be ugly and clumsy.
> A warning is probably a good idea, but it should be added somewhere in
os.fork() and threading documentation.

I was thinking about a run time warning that is emitted if you call os.fork() while multiple threads are active. It is ugly, but at least it tells you you are doing something that will in most cases not work correctly. I certainly agree that a warning should also be added to os.fork() documentation.

I'm attaching an example patch that adds it into _after_fork() in threading.py, but there are a number of other places where it might go instead. 

I believe that the comp.programming.threads post from David Butenhof linked above explains why adding atfork() handlers isn't going to solve this.
History
Date User Action Args
2011-06-30 15:04:08aviansetrecipients: + avian, gregory.p.smith, pitrou, vstinner, nirai, bobbyi, neologix, Giovanni.Bajo, sdaoden
2011-06-30 15:04:08aviansetmessageid: <1309446248.54.0.197690969309.issue6721@psf.upfronthosting.co.za>
2011-06-30 15:04:08avianlinkissue6721 messages
2011-06-30 15:04:07aviancreate