Re:Secrets of dispatch_once; x86 performance trickery
by mikeash on Friday June 06, 2014 @10:16PM
(#7861058)
Doesn't this have all the same problems as the way they currently do it? The only difference between the two is that Apple's implementation puts the flag in a variable, while you're basically proposing to put the flag in code. You still need to ensure proper ordering on both reads and writes and ensure that speculative execution doesn't end up giving you the wrong answer.
[ Parent
| on HN ]
There are no comments on this comment yet.