Boost logo

Boost :

Subject: Re: [boost] [lockfree] review
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-07-30 20:09:45


On Jul 30, 2011, at 5:10 PM, Dave Abrahams wrote:
> on Sat Jul 30 2011, Gordon Woodhull <gordon-AT-woodhull.com> wrote:
>> E.g. we were talking about translating concurrent pseudocode to real
>> code. Without sequential consistency it might require inserting memory
>> barriers and it's never clear where, or if some other architecture is
>> going to need different ones.
>>
>> How is it not better to at least understand that a single piece of
>> code will do what it says in the same order?
>
> Could you show me an example of some single-threaded code that can't be
> understood on the basis of the C++03 standard alone, and give some
> examples of the multiple possible interpretations of its semantics?

No. Sorry, I meant that it's difficult or impossible to reason about a multithreaded program unless the sequence of operations in the individual threads is clear.

It's still very difficult to reason with sequential consistency but it's better than having to consider the higglety-pigglety reordering optimizations of the compiler and processor.

I'm surprised that you don't think it will help - care to shed any light (or darkness)?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk