
6 Oct
2006
6 Oct
'06
1:03 p.m.
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.