[Mono-dev] Control-C handler

Paolo Molaro lupus at ximian.com
Mon Feb 4 06:38:25 EST 2008

On 01/28/08 Jonathan Pryor wrote:
> On Mon, 2008-01-28 at 17:13 -0500, Jonathan Pryor wrote:
> > On Mon, 2008-01-28 at 21:10 +0100, Paolo Molaro wrote:
> > > Deregistration is handled incorrectly: if there are two handlers for the
> > > same signal it gets disabled at the first uninstall.
> This has been fixed.

Thanks, this looks much better.

> So the only remaining question, to me, is the type and ordering of the
> UnixSignal.WaitAny() methods (i.e. the 'params' question).

I'm not sure why you think it is a problem: there used to be a bug in
mcs when the params array wasn't the last argument, but I think it has
been fixed, you may want to check that.

You should write a test case to stress-test this code and see if it
behaves correctly under a storm of signals, say at least 100k signals.
You should check that no signal was lost. Repeat the same while one
thread adds/removes handlers. Repeat with two threads doing a WaitAny()
and using more than one signal. Repeat with two threads calling kill()
to send the signal. Do all of this on a SMP box.
The code is ok for HEAD, once it passes the above stress tests it can go
also into the 1.9 branch, IMO (what should go right away in the branch
it the Obsolete attribute for signal()).


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list