On Tue, Sep 1, 2009 at 2:58 PM, "Martin v. Löwis"<martin at v.loewis.de> wrote: >> On one hand, you may not want to call the user's atexit handlers >> multiple times from different processes if they have externally >> visible effects. On the other hand, people seem to assume that >> Py_Finalize will be called at process exit to do various cleanups. On >> the third hand, maybe Python could just clear out all the atexit >> handlers in the child after a fork. So what should the correct >> behavior be? > > Standard POSIX fork semantics should be a guidance. IIUC, termination > of the last thread is equivalent to calling exit(0) (although return > from main() still means that exit is invoked right away, and the return > value of main is the exit code - right?). Calling exit means to call > all exit handlers. It depends, there is also _exit, which exists solely for the purpose of working around exit handlers being called from a forked child process at exit. Which semantics should Python have? In my opinion, it is more obvious that the user's handlers would be called than not, so I agree with you. Reid
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