[c++-pthreads] thread-safety definition

Alexander Terekhov boo at terekhov.de
Fri Jan 9 13:20:12 UTC 2004


Richard Henderson wrote:
> 
> On Thu, Jan 08, 2004 at 03:43:52PM +0100, Alexander Terekhov wrote:
> > C++ aside for a moment, I have yet to see async-cancel-UNsafe
> > implementation of, say, strlen(). Care to inspire me? TIA.
> 
> I have yet to see an async-safe exception runtime.  It's certainly
> possible, but it requires the addition of lots of memory barriers
> to the code.  

Huh? Let's talk about memory barriers next week, okay?

http://www.terekhov.de/pthread_refcount_t/draft-edits.txt
http://groups.google.com/groups?selm=3EEF38E8.311EEC77%40web.de
http://www.terekhov.de/pthread_refcount_t/experimental/refcount.cpp

>              Which no one adds because all C++ exceptions are
> synchronous [1].  Even Java exceptions are synchronous; the times

Well, http://www.rtj.org/rtsj-V1.0.pdf

"When a method is declared with AsynchronouslyInterruptedException 
 in its throws clause the platform is expected to asynchronously 
 throw this exception if RealtimeThread.interrupt() is called while 
 the method is executing, or if such an interrupt is pending any 
 time control returns to the method. The interrupt is not thrown 
 while any methods it invokes are executing, unless they are, in 
 turn, declared to throw the exception. This is intended to allow 
 long-running computations to be terminated without the overhead 
 or latency of polling with java.lang.Thread.interrupted().

 The throws AsynchronouslyInterruptedException clause is a marker 
 on a stack frame which allows a method to be statically marked as 
 asynchronously interruptible."

regards,
alexander.

P.S. http://tinyurl.com/2lfoz



More information about the c++-pthreads mailing list