Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #1849

Re: forcing the compiler to reload from memory with c++0x

From Alexander Terekhov <terekhov@web.de>
Newsgroups comp.programming.threads
Subject Re: forcing the compiler to reload from memory with c++0x
Date 2011-01-28 14:39 +0100
Organization A noiseless patient Spider
Message-ID <4D42C708.76F505FC@web.de> (permalink)
References <4d3cee42$0$1209$426a74cc@news.free.fr> <1d21ad0a-db55-460e-aeb6-66f6d19369ea@i13g2000yqe.googlegroups.com> <4d3e2e3f$0$21517$426a34cc@news.free.fr> <4D40A4C7.16E6F9AE@web.de> <4d421fa3$0$1815$426a34cc@news.free.fr>

Show all headers | View raw


David Jobet wrote:
> 
> Alexander Terekhov wrote:
> 
> > initial thread: x = y = 0:
> >
> > thread A: if (x) y = x;
> >
> > thread B: if (y) x = y;
> >
> > The final outcome (x | y) != 0 is prohibited without any atomics and its
> > memory ordering.
> >
> > I call that an implied code-conditional hoist-store barrier constraint.
> 
> Hello Alexander,
> 
> I though we needed a memory model precisely because the current spec does
> not say anything about threads !
> Since your example is about program correctness in presence of thread, and
> our current spec does not say anything about thread, can you elaborate ?

I meant C++0x. Under C++0x the example above is valid and has no data
races.

regards,
alexander.

Back to comp.programming.threads | Previous | NextPrevious in thread | Find similar


Thread

Re: forcing the compiler to reload from memory with c++0x David Jobet <david.jobet@free.fr> - 2011-01-27 20:45 -0500
  Re: forcing the compiler to reload from memory with c++0x Alexander Terekhov <terekhov@web.de> - 2011-01-28 14:39 +0100

csiph-web