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.

Author jnoller
Recipients jnoller
Date 2009-08-05.20:39:51
SpamBayes Score 3.1603835e-05
Marked as misclassified No
Message-id <1249504797.36.0.666039948404.issue6653@psf.upfronthosting.co.za>
In-reply-to
Content
> Calling os.exit in a child process may be dangerous. It can cause 
> unflushed buffers to be flushed twice: once in the parent and once in 
> the child. 

I assume you mean sys.exit. If this is the case, multiprocessing needs 
a mechanism to chose between os._exit and sys.exit for child 
processes. Calling os._exit might also be dangerous because it could 
prevent necessary clean-up code from executing  (e.g. in C 
extensions). I had a case where shared memory on Linux (System V IPC) 
leaked due to os._exit. The deallocator for my extension type never 
got to execute in child processes. The deallocator was needed to 
release the shared segment when its reference count dropped to 0. 
Changing to sys.exit solved the problem. On Windows there was no leak, 
because the kernel did the reference counting.
History
Date User Action Args
2009-08-05 20:39:57jnollersetrecipients: + jnoller
2009-08-05 20:39:57jnollersetmessageid: <1249504797.36.0.666039948404.issue6653@psf.upfronthosting.co.za>
2009-08-05 20:39:52jnollerlinkissue6653 messages
2009-08-05 20:39:51jnollercreate