Join Nostr
2025-02-25 20:23:38 UTC
in reply to

Guy English on Nostr: nprofile1q…s4heg It’s logically similar but not quite. Here’s ...

It’s logically similar but not quite. Here’s with more than you ever wanted to know about it:

https://www.mikeash.com/pyblog/friday-qa-2014-06-06-secrets-of-dispatch_once.html

(Long story short—pthread_once takes an OS lock and will block in the kernel. This isn’t needed for dispatch_once so it uses atomic operations to achieve the same result)