Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jun 1998 08:39:02 +1000 (EST)
From:      John Birrell  <jb@cimlogic.com.au>
To:        smoergrd@oslo.geco-prakla.slb.com (Dag-Erling Coidan Smørgrav)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Signals in POSIX threads
Message-ID:  <199806192239.IAA22404@cimlogic.com.au>
In-Reply-To: <rx4yautd2gg.fsf@oslo.geco-prakla.slb.com> from =?ISO-8859-1?Q?Dag=2DErling_Coidan_Sm=F8rgrav?= at "Jun 19, 98 02:02:23 pm"

next in thread | previous in thread | raw e-mail | index | archive | help

Dag-Erling Coidan Smørgrav wrote:
> This is not strictly FreeBSD-related, but I thought I'd ask here since
> many of you are probably working with pthreads at some level.
> 
> Is there any way to force all (or specific) signals sent to a process
> to be sent to a particular thread? The behaviour I'm seeing now¹ is
> that the signal is going to a seemingly random thread². Wether the
> signal handler is being installed before or after the threads are
> started doesn't seem to make a difference.
> 
> I asked a colleague at Geco about it, and his answer was "Whatever you
> want to do, find a way to do it that doesn't involve signals." Not
> very helpful :)

POSIX threaded processes only have one set of signal handlers but a
thread specific signal mask. POSIX says that "at the time of generation,
a determination shall be made whether the signal has been generated
for the process or for a specific thread within the process". But without
each thread being able to choose a signal handler, it is not really
very useful.

I'd agree with your colleague. 8-) It is best to write threaded
applications to work in the presence of signals, but to avoid using
them for anything thread specific.

What are you doing that _needs_ signals?

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806192239.IAA22404>