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

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



Fergus Henderson wrote:
> 
> On 12-Jan-2004, Alexander Terekhov <boo@xxxxxxxxxxx> wrote:
> > Fergus Henderson wrote:
> > >
> > > On 09-Jan-2004, Alexander Terekhov <boo@xxxxxxxxxxx> wrote:
> > > > 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
> > >
> > > What is the relevance of those URLs?
> >
> > This stuff is about memory barriers aka memory synchronization.
> 
> Well, I know what memory barriers are. 

I doubt you know what "hoist" and "sink" memory barriers are. ;-)
 
>                                        Is there any reason why I should
> bother to read the stuff at those URLs?  In particular, do those URLs
> have any relevance to Richard Henderson's comment, 

In POSIX, cancellation runs in the context of canceled thread. There's
a context switch, so to speak. And, more importantly, cancellation (just
like pthread_kill() signaling) does NOT have any memory synchronization 
effects at all.

>                                                    or to how to combine
> Posix threads and C++?

Your latest comment implied to me that you want pthread_cancel() (and/or
"the C++ version" of it) and cancellation request delivery be added to 
the "XBD 4.10" (in "POSIX.C++", at least).

regards,
alexander.