From: val salamakha (v_s_ha_at_[hidden])
Date: 2004-10-03 08:52:21
--- Peter Dimov <pdimov_at_[hidden]> wrote:
> Ben Hutchings wrote:
> > Peter Dimov <pdimov_at_[hidden]> wrote:
> >> Alexander Terekhov wrote:
> >>> C'mon, volatile is brain-dead.
> >> Nobody's arguing otherwise. ;-) But a nop it
> > I think Alexander is arguing that without a clear
> definition of what
> > it means for a memory access to be "observable",
> A memory access is observable if and only if the
> variable is volatile.
> > the fact that
> > volatile memory accesses are "observable
> behaviour" doesn't prevent
> > them from being optimised away under the as-if
> A compiler is not allowed to alter the observable
> behavior under the "as if"
> rule. 1.9/1.
I recently read the article "Double-Checked Locking,
Threads, Compiler Optimizations, and More" of Scott
Meyers where he touched the Sequence Points and
Observable Behavior, Compiler Optimizations and
Instruction Reodering. He is more convincing than
Alexander; "road to the thread-safe code isn't paved
(the presentation is available from
Do you Yahoo!?
Declare Yourself - Register online to vote today!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk