[c++-pthreads] thread-safety definition
Jason Merrill
jason at redhat.com
Thu Jan 8 18:49:28 UTC 2004
On Thu, 08 Jan 2004 11:00:51 +0100, Mathieu Lacage <Mathieu.Lacage at sophia.inria.fr> wrote:
> 2.2) "defered cancelation": I know of only POSIX to implement this. The
> canceled flag for the target thread is set and the thread cancelation
> handlers are invoked whenever the thread reaches a cancelation point
> (that is, it calls one of a set of specific library functions).
While we're enumerating existing practice...
Deferred cancellation is also a feature of the Java (Thread.interrupt) and
Ada (task abort) threading models.
In Java, cancellation is implemented by throwing an InterruptedException.
The cancellation points are Object.wait, Thread.join and Thread.sleep. In
particular, an interrupt does not wake up a thread blocked on a lock or
I/O.
In Ada, cancellation runs cleanups, but is not defined to be an exception,
though it is often implemented as one. In particular, it cannot be caught
by exception handlers in user code.
Jason
More information about the c++-pthreads
mailing list