Hacker News new | ask | show | jobs
by staticassertion 1456 days ago
> and if you’re not, why use a mutex?

Because it's an incredibly efficient, safe option for doing so. Lots of shared state is rarely contended. For example, imagine you have a 'Config' that gets updated periodically in the background, readers of that config only check for updates every 1 second, and you have 7 parallel readers (and 1 writer for an 8 core system).

A Mutex is a trivial way to solve that problem that will be extremely efficient.