> 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. So to match POSIX semantics, we should also call the exit handlers in the child process (along with invoking a final garbage collection etc.) Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com