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


Groups > comp.lang.c++ > #6778

Re: Threading question - read-read coherency almost, sort of, with seq_cst fences

From "Chris M. Thomasson" <cristom@charter.net>
Newsgroups comp.lang.c++
References <c4891256-0c18-4eab-a227-ba819263d133@v11g2000prk.googlegroups.com>
Subject Re: Threading question - read-read coherency almost, sort of, with seq_cst fences
Message-ID <fgiKp.1272$tp.587@newsfe06.iad> (permalink)
Date 2011-06-16 00:28 -0700

Show all headers | View raw


"Joshua Maurice" <joshuamaurice@gmail.com> wrote in message 
news:c4891256-0c18-4eab-a227-ba819263d133@v11g2000prk.googlegroups.com...
> Ok. This is coming from a recent thread in comp.programming.threads,
> talking about C++0x. (You don't need to review it. I'll provide the
> relevant context here.)
>
> "questions about memory_order_seq_cst fence"
> http://groups.google.com/group/comp.programming.threads/browse_thread/thread/0158f1f2bca1019e#
>
> Consider the following code.
[...]

> Q1. First, am I right in concluding that in the above code, all of the
> loads and stores might as well be memory_order_relaxed, right?

I think you are correct.


> Q2. Second, is the following end condition possible?
>  r1 == 0 && r2 == 1 && r3 == 0

FWIW, Relacy Race Detector says that the condition is indeed possible; here 
is a test case:

http://pastebin.com/G4yDLyRy

[...] 

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Threading question - read-read coherency almost, sort of, with seq_cst fences Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-15 16:56 -0700
  Re: Threading question - read-read coherency almost, sort of, with seq_cst fences "Chris M. Thomasson" <cristom@charter.net> - 2011-06-16 00:28 -0700
    Re: Threading question - read-read coherency almost, sort of, with seq_cst fences "Chris M. Thomasson" <cristom@charter.net> - 2011-06-16 00:41 -0700
      Re: Threading question - read-read coherency almost, sort of, with seq_cst fences Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-16 02:47 -0700
        Re: Threading question - read-read coherency almost, sort of, with seq_cst fences Anthony Williams <anthony.ajw@gmail.com> - 2011-06-16 11:45 +0100
          Re: Threading question - read-read coherency almost, sort of, with seq_cst fences "Chris M. Thomasson" <cristom@charter.net> - 2011-06-16 14:32 -0700
  Re: Threading question - read-read coherency almost, sort of, with seq_cst fences Anthony Williams <anthony.ajw@gmail.com> - 2011-06-16 09:42 +0100
    Re: Threading question - read-read coherency almost, sort of, with seq_cst fences Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-16 02:50 -0700
      Re: Threading question - read-read coherency almost, sort of, with seq_cst fences Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-16 02:53 -0700

csiph-web