[cpp-threads] [Javamemorymodel-discussion] there's a happens-before orderhere. right?

Boehm, Hans hans.boehm at hp.com
Tue Dec 16 01:22:19 GMT 2008



> -----Original Message-----
> From: cpp-threads-bounces at decadentplace.org.uk
> [mailto:cpp-threads-bounces at decadentplace.org.uk] On Behalf
> Of Alexander Terekhov
> Sent: Monday, December 15, 2008 5:08 PM
> To: paulmck at linux.vnet.ibm.com
> Cc: Endre Stølsvik; C++ threads standardisation;
> javamemorymodel-discussion at cs.umd.edu
> Subject: Re: [cpp-threads] [Javamemorymodel-discussion]
> there's a happens-before orderhere. right?
>
> On Tue, Dec 16, 2008 at 12:41 AM, Paul E. McKenney
> <paulmck at linux.vnet.ibm.com> wrote:
> [...]
> > Indeed -- although PowerPC respects control dependencies, other
> > architectures apparently do not.
>
> I'm not sure about "apparently". AFAIK, there isn't a
> clear/apparent "no" regarding respect of control dependencies
> for load-control-dependent-store case. Silence is open to
> interpretation... ;-)
My impression is that ARM does not respect control dependencies, at least according to the spec.  Itanium does, but uses a weaker definition.  If we write the assembly version of

if (x) y = 1;
z = 1;

using a branch,

the assignment to z is not control dependent on x for Itanium, but I believe it is for PowerPC.

This may be a problem even for PowerPC at the C++ level, if the if-statement is translated to a conditional move?  That's certainly likely to happen on Itanium, aside from the hardware issue.

PowerPC and ARM (and possibly embedded MIPS?) are probably the most important architectures for these discussions, since the other major architectures are likely to convert memory_order_consume to memory_order_acquire anyway, for various reasons.

Hans

>
> regards,
> alexander.
>
> --
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk
> http://www.decadentplace.org.uk/cgi-bin/mailman/listinfo/cpp-threads
>



More information about the cpp-threads mailing list