Author jnoller
Recipients jnoller
Date 2009-08-05.20:39:51
SpamBayes Score 3.16038e-05
Marked as misclassified No
Message-id <>
> 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.
Date User Action Args
2009-08-05 20:39:57jnollersetrecipients: + jnoller
2009-08-05 20:39:57jnollersetmessageid: <>
2009-08-05 20:39:52jnollerlinkissue6653 messages
2009-08-05 20:39:51jnollercreate