[cpp-threads] out-of-thin-air results, depndency-based ordering again.

Boehm, Hans hans.boehm at hp.com
Thu Feb 15 22:45:19 GMT 2007


I've been trying to generate a revision to N2052 that prohibits
out-of-thin-air results without enforcing anything like dependency-based
ordering, since I'm increasingly convinced that's undefinable, even in
the limited cases in which we previously made the attempt.  After
convincing myself that the alternative approach I had in mind wouldn't
work either, I wrote up a summary of the state of affairs, with a
proposal to approach this a bit differently, in

http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/thin_air.html

Please post if you have any comments.  In the absence of strong
objections, I will adjust the N2052-successor paper accordingly.  (Note
that this would move the sticky part of this problem into the
description of the atomics library, where I now think it really
belongs.)

This does not address getting dependency-based ordering for the sake of
dependency-based ordering.  Following Herb's approach, might it be
possible to handle that in limited cases with a more specific primitive,
e.g. a function that retrieves both an atomic pointer and its referent
(if the pointer is non-null), ensuring that the pointer access is
ordered before the accesses to the object?  In the (common?) case that
the referent is a large structure, we would have to rely on compiler
optimizations to eliminate the full copy if only parts of the object are
accessed.  Or is there a different interface that guarantees that the
whole dependency chain is visible to the compiler at once?

Hans



More information about the cpp-threads mailing list