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.

作者 avian
收信人 Giovanni.Bajo, avian, bobbyi, gregory.p.smith, neologix, nirai, pitrou, sdaoden, vstinner
日期 2011-06-30.15:04:07
SpamBayes Score 1.937479e-10
Marked as misclassified
Message-id <1309446248.54.0.197690969309.issue6721@psf.upfronthosting.co.za>
In-reply-to
内容
> 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.
历史
日期 用户 动作 参数
2011-06-30 15:04:08avian修改recipients: + avian, gregory.p.smith, pitrou, vstinner, nirai, bobbyi, neologix, Giovanni.Bajo, sdaoden
2011-06-30 15:04:08avian修改messageid: <1309446248.54.0.197690969309.issue6721@psf.upfronthosting.co.za>
2011-06-30 15:04:08avian链接issue6721 messages
2011-06-30 15:04:07avian创建