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 12-Jan-2004, Alexander Terekhov <boo@xxxxxxxxxxx> wrote:
> 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.

The first URL was a 23-page slab of standardese, apparently "additions
to the XBD 4.10 Memory Synchronization" and maybe some other stuff.
There was no explanatory text to give any hint of the rationale for these
changes.  I see no point reading 23 pages of standardese if you can't be
bothered telling us what you are trying to achieve with those 23 pages of
standardese.

> >                                                    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).

If thread cancellation involves passing data between the canceler and the
cancellee, as I have suggested would make sense for C++, then clearly
some memory synchronization will be required.  I haven't analyzed it
in great detail, but at first glance I don't see that being a problem.
After all, cancellation should be a very rare event.

-- 
Fergus Henderson <fjh@xxxxxxxxxxx>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.