Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Sep 2001 20:10:37 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        julian@FreeBSD.ORG, arch@FreeBSD.ORG
Subject:   Re: sigsuspend() and KSE
Message-ID:  <Pine.SUN.3.91.1010919195624.17296A@pcnet1.pcnet.com>
In-Reply-To: <XFMail.010919161625.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 19 Sep 2001, John Baldwin wrote:
> >From the KSE commit the following was added regarding sigsuspend:
> 
> /*
>  * Suspend process until signal, providing mask to be set
>  * in the meantime.  Note nonstandard calling convention:
>  * libc stub passes mask, not pointer, to save a copyin.
>  ***** XXXKSE this doesn't make sense under KSE.
>  ***** Do we suspend the thread or all threads in the process?
>  ***** How do we suspend threads running NOW on another processor?
>  */
> 
> Here's my opinion:
> 
> sigsuspend() just suspends the current thread.  When a signal is posted, it
> wakes up all threads blocked on sigsuspend whose mask matches that signal.  I
> can see it still making sense, but perhaps being of limited usefulness in a
> threaded program.

Right.  sigsuspend should only block the calling thread and result
into an upcall into the threads library.  This really shouldn't
be any different than a thread blocking on I/O.  Since signals
are sent to the UTS via an upcall, the UTS can direct it to the
correct thread (waking up the previously sigsuspend'd thread if
necessary).  Threads in sigwait have preference over sigsuspend.

And a signal posted only wakes up at most 1 thread waiting in
sigsuspend (if there are multiple threads waiting for the
same signal, only one of them gets woken -- or POSIX says that
is undefined, I forget which).

-- 
Dan Eischen

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?Pine.SUN.3.91.1010919195624.17296A>