
Secrets of Cocoa's dispatch_once - gmac
https://www.mikeash.com/pyblog/friday-qa-2014-06-06-secrets-of-dispatch_once.html
======
pcwalton
I really like this article, because it's a great description of the level of
hardware knowledge you must be programming with in order to successfully elide
atomics on the fast path for concurrent programming on multicore.

If you aren't familiar with your CPU architecture on the _microcode_ level,
don't risk it. Your naive double-checked locking code is almost certainly
broken. Just use atomics on the fast path.

~~~
CyberDildonics
> Your naive double-checked locking code is almost certainly broken

Is there anywhere I can read a little more about this?

------
saurik
[https://news.ycombinator.com/item?id=7860531](https://news.ycombinator.com/item?id=7860531)

------
alblue
(2014)

