[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cma

Title:DECthreads Conference
Moderator:PTHRED::MARYSTEON
Created:Mon May 14 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1553
Total number of notes:9541

1474.0. "Is sigwait () cancellable?" by ANNECY::LAROCHE_P (Ne Suze que si l'on Sancerre) Wed Jan 29 1997 09:06

Hello,

the guide to DECthread states that the sigwait () function is a cancellable
point.

I have a thread that uses sigwait to wait for the SIGTERM and SIGINT signals
to be delivered. If I exit from my program properly, I try to cancel this
thread, but it does not work.

Is sigwait() really a cancellation point?

Thank you in advance,
Pierre

OS = DIGITAL UNIX V4.0, the thread code is compiled using the -threads
switch of the compiler (old pthread interface).
T.RTitleUserPersonal
Name
DateLines
1474.1DCETHD::BUTENHOFDave Butenhof, DECthreadsWed Jan 29 1997 09:4728
> OS = DIGITAL UNIX V4.0, the thread code is compiled using the -threads
> switch of the compiler (old pthread interface).

Thanks for answering the question ;-) Or at least, providing enough
information for me to answer it trivially, which is almost the same thing.

The sigwait() function is implemented in the kernel. Prior to Digital UNIX
4.0, the kernel did not support cancellation of blocking functions, and,
therefore, sigwait() could not be a cancellation point.

In Digital UNIX 4.0, this is no longer a problem, and sigwait() IS a
cancellation point. BUT... inevitably, people rely on bugs and restrictions,
and we are aware of many products (& customers) who rely on kernel blocking
functions NOT being cancellation points. There was no easy way to resolve
this quandary.

Thus, we fixed the problem AND maintained binary compatibility by allowing
"system cancellation" only in threads created using the POSIX threads
interface. Threads created using the obsolete CMA interface or the retired
DCE threads interface have "system cancellation" disabled. There's no
interface to change this -- after all, if you don't want compatibility with
the old version, you should port to POSIX threads anyway.

The fact that you are building with "-threads" means that you are using
either the CMA or DCE threads interface rather than POSIX threads, so you
cannot cancel any blocking system call -- including sigwait().

	/dave