Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-08-27 20:25:31


Peter Dimov wrote:
> Tobias Schwinger:
>
>> Most processors have linear write buffers and if 'initialized' is seen
>> as true the object has been written, too.
>
> The write buffer in thread 1 doesn't affect the reads in thread 2, which can
> still be reordered.
>
> True if by "most processors" you mean "x86", though, absent compiler
> optimizations.

Well, the article I referenced states that in the particular case we
have been discussing one can get away without a second read barrier for
PPC as well.

Did you catch the full context (as the code was truncated in the
previous post)?

AFAIK (not claiming to be an expert in this field, however) it takes a
rather atypical processor architecture to pull load instructions out of
their regular execution path (logically) before a conditional branch, no?

> Hasn't Anthony Williams already implemented a header-only call_once? I'm not
> sure I see a reason to reinvent that particular wheel. Once boost::mutex is
> made header-only, there'd be no need for lightweight_mutex either and I'll
> be able to retire it as well.

Where can I find it?

Regards,
Tobias


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