News for hackers. Stuff that matters.
Re:A simple hash table in C by marginalia_nu on Wednesday June 14, 2023 @04:25AM (#36323070)
You can't really know that though.

Without appropriate memory barriers, you can end up with an inconsistent view of the memory due to out-of-order execution and other weird stuff the CPU does behind the scenes.

There's significant footguns around low level concurrency primitives.

Re:A simple hash table in C by ryao on Wednesday June 14, 2023 @09:33AM (#36325650)
If you are doing locking to protect against writes occurring when reads occur, you get those barriers for free.

That said, they are using RCU to allow writers and readers to operate concurrently.