➜

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.10:05:35
SpamBayes Score 1.3347434e-08
Marked as misclassified 否
Message-id <1309428337.09.0.842472815121.issue6721@psf.upfronthosting.co.za>
In-reply-to
内容
The way I see it is that Charles-François' patch trades a possibility of a deadlock for a possibility of a child process running with inconsistent states due to forcibly reinitialized locks.

Personally, I would rather have an occasional deadlock than an occasional random crash.

I don't like increasing complexity with fine-grained locking either. While the general case is unsolvable what Giovanni proposed at least solves the specific case where only the basic IO code is involved after a fork. In hindsight the only real life use-case I can find that it would solve is doing an exec() right after a fork().

There are quite a few bugs in the tracker that seem to have this same root cause, so it appears the impossibility of cleanly handling threads and forks is not something people are generally aware of. Since I think we agree you can't just disable fork() when multiple threads are running, how about at least issuing a warning in that case? That would be a two-line change in threading.py.
历史
日期 用户 动作 参数
2011-06-30 10:05:37avian修改recipients: + avian, gregory.p.smith, pitrou, vstinner, nirai, bobbyi, neologix, Giovanni.Bajo, sdaoden
2011-06-30 10:05:37avian修改messageid: <1309428337.09.0.842472815121.issue6721@psf.upfronthosting.co.za>
2011-06-30 10:05:36avian链接issue6721 messages
2011-06-30 10:05:35avian创建