[488] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: New Pthreads Book

daemon@ATHENA.MIT.EDU (Christopher Provenzano)
Fri Nov 8 04:00:27 1996

Reply-To: proven@cygnus.com
To: Chris Colohan <colohan@eecg.toronto.edu>
Cc: pthreads@MIT.EDU
In-Reply-To: Your message of "Mon, 04 Nov 1996 17:50:53 EST."
             <96Nov4.175056est.35(2)@picton.eecg.toronto.edu> 
Date: Fri, 08 Nov 1996 03:24:31 -0500
From: Christopher Provenzano <proven@proven.org>


> The book claims to cover Posix 1003.1c -- is this the same version of
> the standard that MIT-Pthreads is coded to?  Is it reasonable for me
> to expect Pthreads to behave in the same manner as outlined in this
> book, especially when it comes to signal handling etc?

For the most part... see below.

> 
> If so, I have found a couple of small (trivial) bugs in Pthreads:
> - The structure element sched_param.prio should be named
> sched_param.sched_priority.

Fixed in next release.

> - The functions sched_get_priority_max() and sched_get_priority_min()
> seem to be missing...

They'll be in the next release.

> In addition, this book answered an earlier question I had that wansn't
> answered on this mailing list -- How to call pthreads functions in a
> signal handler.  The short answer is:  you can't.  The long answer is:

For most implementations this is true. The way I've implemented signals
though you should be able to just call any pthread routine without worry.
Currently the problem is installing signal handlers. Currently you need
to use the routines pthread_signal() or pthread_sigaction() (Same prototype
and signal() and sigaction()) This is because internally I use signal()
and sigaction() in the pthread engine and I haven't written the appropriate
machdep_sys_*() wrappers routines to replace the internal signal() and 
sigaction() routines yet. 

> 
> - Block the signal on all threads.
> - Create a very high priority signal handling thread that is of the
> following format:
> while(1) {
>     sigwait(&my_sigmask, &caught);
>     handle the signal...
> }

This is the ideal way of handling signals and is supported.

CAP

home help back first fref pref prev next nref lref last post