[c++-pthreads] thread-safety definition

Alexander Terekhov boo at terekhov.de
Mon Jan 12 14:30:10 UTC 2004


Fergus Henderson wrote:
[...]
> > > > > > 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.

Well, thread-safe reference counting (hello tr1::shared_ptr and
tr1::weak_ptr) aside for a moment, see

http://groups.google.com/groups?selm=3EE75F28.76EC29B4%40web.de
http://groups.google.com/groups?selm=3FAA2DC0.42F602DB%40web.de
http://groups.google.com/groups?selm=3FD09072.BB1BEAF1%40web.de

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

Agreed. Oh, BTW, with respect to pthread_kill()... perhaps you might 
want (reason: sort of "similar issue" with respect to msync plus 
cancellation/errno silliness in the context of async handlers) to 
take a look at the following thread:

http://groups.google.com/groups?threadm=3F60A3B0.7E035CBD%40web.de

What do you think?

regards,
alexander.



More information about the c++-pthreads mailing list