Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2001 20:29:46 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        Jason Evans <jasone@canonware.com>, arch@FreeBSD.ORG
Subject:   Re: help needed in threads.. (Signals)
Message-ID:  <3B4BC829.C3879AF2@elischer.org>
References:  <Pine.SUN.3.91.1010710080954.5316A@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Eischen wrote:
> 
Ok so I think I have it 'kinda' worked out in my head..
there are some loose ends however that depend on how the interrupt masks etc are
handled...



In KSE mode:
1/ is there still a "per process" signal mask, and set of handler
addresses? Or just separate ones per thread?

2/ are there separate handlers registerable per thread? (i.e. if thread A gets 
a SIGHUP call hangup() but if thread B gets a SIGHUP, call reload())

3/ Is it possible that each thread has a mask but that the handlers are shared?


(by mask I mean a block mask, and an IGN mask at least.)

If all threads block an interrupt, does the process then block it? 
(or does it still get to the UTS? Does the UTS have to block it fo the 
whole process explicitly if it doesn't want to see it?

If a thread is designated to take an interrupt and it is blocked in
the kernel, then the same rules apply as for a current process.
however is the fact that a syscall is restartable, a process wide
setting or a thread-specific setting?

To make sense I think the flags SA_NOCLDSTOP, SA_NOCLDWAIT are definitly
per process. The SA_RESTART could have arguments each way, and similarly
SA_ONSTACK ans SA_NODEFER and SA_RESETHAND might also be per thread.

Certainly If you are nominating a thread to take each kind of interrupt
then it makes no sense to have per-thread values for these.

but if the threads declare their own interest, then they could
have their own masks etc. In that case it makes sense to deliver the
signal to ALL threads that express an interest in a particular signal.

(I could imagine for example that two threads may want to know about the 
SIGHUP that indicates a restart of a daemon).
Similarly  a SIGTSTP should be sent to all threads in the default case
because you want the entire program to suspend, Similarly you want SIGCONT
to continue all threads.


What semantics are we looking for?

Julian.


-- 
+------------------------------------+       ______ _  __
|   __--_|\  Julian Elischer         |       \     U \/ / hard at work in 
|  /       \ julian@elischer.org     +------>x   USA    \ a very strange
| (   OZ    )                                \___   ___ | country !
+- X_.---._/    presently in San Francisco       \_/   \\
          v

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




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