svn commit: samba r20928 - in branches/SAMBA_4_0/source/lib/events: .

tridge at tridge at
Sun Jan 21 20:27:38 GMT 2007


 > The only reliable trick I found is to use the hack-pipe as
 > the signalling mechanism itself.

You mean write signal numbers to the pipe? The pipe can fill, so you'd
need an overflow mechanism. That could be worked around by using the
same "block signals when pipe overflows" technique (same as I use for

I had looked at writing the signal numbers to the pipe but I decided
not to as the write() to the pipe inside the signal handler could be
interrupted by a signal, which would lead to a lost signal. We could
use sa_mask to avoid that perhaps, by masking all signals inside
signal handlers.

Another way to avoid atomic increments is to use a pair of
counters. So instead of incrementing count inside the handler and
decrementing outside you have two counters. One is incremented inside
the handler and the other incremented outside. You subtract (with
wraparound handling) to get the count. That is race free (from the
point of view of destroying the counter).

Cheers, Tridge

More information about the samba-technical mailing list