Re: [c++-pthreads] thread-safety definition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] thread-safety definition



On Thu, 08 Jan 2004 11:00:51 +0100, Mathieu Lacage <Mathieu.Lacage@xxxxxxxxxxxxxxx> 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