What is Nostr?
gentoobro /
npub1atr…33ln
2025-01-01 04:48:49
in reply to nevent1q…kgda

gentoobro on Nostr: I use spinlocks implemented with atomics for nearly everything except controlling the ...

I use spinlocks implemented with atomics for nearly everything except controlling the threads themselves. Spinlocks are way faster than other options in my tests on desktops, even in contrived, highly contested test scenarios.

Remember, the kernel essentially has to use atomics to implement all its synchronization syscalls, and spinning on a lock for a few hundred cycles is still way faster than a syscall's overhead.
Author Public Key
npub1atr96fjv7t7jje04nfxpq4am322yygzeeccv6t4a4dmu3d9s9ygscw33ln