Subject: Re: Sempahore on NetBSD work or no ?
To: Zoltan ZSIDO <zsido@westel900.net>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: current-users
Date: 01/28/2003 14:08:28
Zoltan ZSIDO <zsido@westel900.net> writes:

> Sorry I was amiguous. Using DEC's and HP's implementation You will not
> suffer from select(2) caused problems. I'v seen this 'problem' only on
> Solaris. The compliancy is about threaded signal handling. The
> specification doesn't specify that the issuer of an alarm(2) call will be
> signalled by the SIGALRM. It says only, that the signal will be delivered
> to the process, so the next thread which is capable of handling this
> signal will catch it or the process will be killed if no one thread
> willing to catch it. All of the mentioned implementation conform to this
> specification, but - as an undocumented feature - on OSF/1 and HP-UX it
> will be delivered to the issuer thread always, on Solaris this will not be
> garantied.

Ah. This is easily handled by the application, though; block SIGALRM
in the threads that are calling select(). I would say that in general,
in a threaded universe, one should call pthread_sigmask() first and
ask questions later.

        - Nathan