buffered signal

David Xu davidxu at FreeBSD.org
Wed Aug 20 14:44:33 PDT 2003


Dan,

I am thinking about a problem with buffered signals.
Suppose if libkse is in critical region and signal A and B arrived,
then A and B are buffered. Later, after thread leaves critical region,
thread starts to process buffered signal A, before it can process A,
another signal C arrived, so thread starts to process signal C,
then in signal handler of C, it masks signal A in kernel and returns,
so signal won't be processed in future because we current test kernel signal
to see if A is masked. Though A is already delivered to userland but
will never be processed! we never check this blocked signal A in
pthread_sigmask,and sigpending() and sigsuspend(), sigwait...., possible
we can repost it to kernel, but may have side effect, for example,
it would lose orignal siginfo meaning.

When A is masked, it must be masked by a signal handler by another new
signal but not by normal user code, because buffered signal can only happen
when it is executing libkse code, and further think that changing signal
mask in signal handler is always not stable and not suggested, I think
we can always process all buffered signals and ignore kernel signal mask.
I am not very sure if it is legal, but shouldn't have problem in real
world.  ;-)

Regards,
David Xu




More information about the freebsd-threads mailing list