Subject: Re: NetBSD is not Linux
To: Stephane St Hilaire <email@example.com>
From: Giles Lean <firstname.lastname@example.org>
Date: 06/14/2001 18:31:02
> I'm not sure I understand the nuance, the moment your signal handler gets
> called what does it matter which thread it runs from (hopefully it's the
> thread that generated it) ? Depending on what you typically do in this
> situation, the code should still work. Should the OS generate as many
> signals as you have threads running ?
The POSIX threads standard requires that signals be able to be sent to
processes, not just to threads. Signals are pretty much per-thread
when they're synchronous (SIGSEGV, SIGBUS) but asynchronous signals
from kill(2) are sent to processes.
One of the implications is that a signal can be pending for a process
if all the threads in that process currently have that signal blocked,
but should be delivered to a thread when it unblocks the signal.
The Linux thread-with-pid model doesn't currently allow a signal to be
sent to a process. There has been discussion on the Linux kernel list
about how to enhance the Linux process and kernel thread model to more
fully support POSIX threads.