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.

Title: Need pthread_atfork-like functionality in CPython
Type: enhancement Stage: resolved
Components: Interpreter Core Versions:
Status: closed Resolution: duplicate
Dependencies: Superseder: Allow registering at-fork handlers
View: 16500
Assigned To: twouters Nosy List: gregory.p.smith, jcea, twouters
Priority: low Keywords:

Created on 2009-09-16 20:03 by twouters, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg92715 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2009-09-16 20:03
In order to properly handle multiple threads and fork()-calls from C code 
(rather than os.fork()), Python should provide pthread_atfork()-like 
functionality: a function to call before a fork, to acquire any locks 
that need to be acquired, and a pair of functions to call after the fork, 
in the parent and the child, to release or re-allocate locks. The 
acquisitions should be re-entrant and should not require an existing 
threadstate. Also see <>.
msg92765 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2009-09-17 14:24
For reference, this is related to but 
deals with the C API side of things for an atfork mechanism to be used by 
extension modules.
Date User Action Args
2022-04-11 14:56:53adminsetgithub: 51172
2013-08-21 18:44:31neologixsetstatus: open -> closed
resolution: duplicate
superseder: Allow registering at-fork handlers
stage: needs patch -> resolved
2012-11-24 00:36:01jceasetnosy: + jcea
2009-09-17 14:24:10gregory.p.smithsetnosy: + gregory.p.smith
messages: + msg92765
2009-09-16 20:03:12twouterscreate