Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-10-06 09:03:06


Roland Schwarz wrote:
> John Maddock wrote:
>> ... but I did notice that you needed two calls to
>> call_once? One of the gripes I've had about call_once was that it
>> was rather a heavyweight call: is this still the case?
>
> Hmm, the once it has been running it does a simple
> if (compare_exchange(&flag, 1, 1) == 0)
> {
> }

OK, that's not so bad.

Actually I think my main gripe is that compilers don't do this stuff
automatically, which neither of us has much control over :-(

> and returns. At least on windows I do not expect much overhead. Does
> this address your question? Also this is implementation specific, and
> might be optimized later. My main question was about interface and
> semanitics.

Understood, I'll try and take anothe look.

John.


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