A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-August/112988.html below:

[Python-Dev] issue 6721 "Locks in python standard library should be sanitized on fork"

[Python-Dev] issue 6721 "Locks in python standard library should be sanitized on fork" [Python-Dev] issue 6721 "Locks in python standard library should be sanitized on fork"Charles-François Natali neologix at free.fr
Tue Aug 23 22:07:22 CEST 2011
2011/8/23 Antoine Pitrou <solipsis at pitrou.net>:
> Well, I would consider the I/O locks the most glaring problem. Right
> now, your program can freeze if you happen to do a fork() while e.g.
> the stderr lock is taken by another thread (which is quite common when
> debugging).

Indeed.
To solve this, a similar mechanism could be used: after fork(), in the
child process:
- just reset each I/O lock (destroy/re-create the lock) if we can
guarantee that the file object is in a consistent state (i.e. that all
the invariants hold). That's the approach I used in my initial patch.
- call a fileobject method which resets the I/O lock and sets the file
object to a consistent state (in other word, an atfork handler)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4