[Mono-dev] [PATCHES] Improve process exit/wait handling
kumpera at gmail.com
Fri Mar 18 13:46:35 EDT 2011
On Fri, Mar 18, 2011 at 3:33 PM, Rolf Bjarne Kvinge <rolflists at ya.com>wrote:
> There is a slight problem now which I just found out: SIGCHLD isn't 100%
> reliable. If I start 100 threads, each of them spawning a process, I
> get 98-99 signals (unless I run in gdb, in which case I get the same number
> of signals, but info->si_pid is duplicated in many of them...). This means
> that only waiting for the reported pid will quite often lead to a zombie
> process in my (pathological) test case.
> Attaching revised patch (which is identical to the one in my response to
Patch looks good except for the missing cleanup on shutdown. The way is to
hook it up on _wapi_cleanup.
Signal delivery is never reliable. You patch will probably behave even worse
on osx which doesn't implement posix real time extensions.
The worst part is that to do this reliably, one can only depend on OS
On linux use signalfd with a thread doing a blocking read on it. On OSX you
need to use mach primitives. Other posix-based systems with suck with the
signal version until patches are submitted.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list