[Mono-dev] [PATCHES] Improve process exit/wait handling

Rolf Bjarne Kvinge rolflists at ya.com
Wed Mar 16 19:26:52 EDT 2011


Hi,

Here is a series of patches that improves process waiting,
the first three being trivial:

1) Make the special_wait functions take an alertable flag.

   This doesn't actually change anything, just add a parameter
   to several functions. The alertable flag is used in the
   last patch (so process waiting will now be alertable).

2) Move duplicated pid validation into one method.

   Just a minor refactor to avoid code duplication.

3) When forking ensure the parent's data structures are
   updated before the child execs.

   This is required for the last patch.

4) Improve waiting on processes a lot

   Here are all the juicy bits: I changed process waiting to use
   a SIGCHLD handler and automatically wait on all processes.
   This fixes #668867. I also added a semaphore, so waits are now
   properly handled by using that semaphore instead of polling
   every 100ms.

Comments welcome of course, otherwise I'll commit it next week.

Rolf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-io-layer-Make-the-special_wait-functions-take-an-ale.patch
Type: application/octet-stream
Size: 4695 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110317/d7c7eaa0/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-io-layer-Move-duplicated-pid-validation-into-one-met.patch
Type: application/octet-stream
Size: 2806 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110317/d7c7eaa0/attachment-0005.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-io-layer-When-forking-ensure-the-parent-s-data-struc.patch
Type: application/octet-stream
Size: 2967 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110317/d7c7eaa0/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-io-layer-Improve-waiting-on-processes-a-lot.patch
Type: application/octet-stream
Size: 24149 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110317/d7c7eaa0/attachment-0007.obj 


More information about the Mono-devel-list mailing list