[cpp-threads] RE: "Agenda" for august 23-25 concurrency meeting

Nick Maclaren nmm1 at cus.cam.ac.uk
Thu Aug 31 11:44:46 BST 2006


"Alexander Terekhov" <alexander.terekhov at gmail.com> wrote:
> 
> Well, most people might get surprised that
> 
> http://www.decadentplace.org.uk/pipermail/cpp-threads/2005-September/000610.html             
> can abort() even with Y and Z being POSIX semaphores (sem_getvalue()
> used for loads and sem_post() for stores). But judging from
> Linux/glibc sources, that can well be the case.

Well, I CERTAINLY wouldn't - at least for ordinary atomic variables!
But I do have many years experience with message-passing designs and
systems, and those are a good education on the principle of minimal
assumption.

I am not at all surprised that POSIX semaphores behave the same way,
as I have reported ad tedium that it needs a memory model and doesn't
have one.  Whether semaphores SHOULD be globally consistent is another
matter - there are arguments both ways.

The example shows up very clearly my point about the need to decide
between the pairwise, transitive and global models.  We have agreed
(at least for now) on the transitive, which is probably the right
decision, but it does mean that example may abort.

In turn, that decision could well mean that the library API needs to
think very carefully about barrier primitives, and there may need
to be some that affect only the synchronisation objects and others
that affect only those and atomics, as well as the 'stop the world
and restart it consistently' one that is so expensive.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1 at cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679



More information about the cpp-threads mailing list