3 ms·
If all you need is atomic compare and swap of a word-sized integer; you can probably find that without a mutex. If your structure is larger than your architect
by toast0 4y ago
If all you need is atomic compare and swap of a word-sized integer; you can probably find that without a mutex.
If your structure is larger than your architecture can do atomic compare and swap, then you'll need something else.
Mutexes usually give you a mechanism to wait for held locks as well. Often without spinning, sometimes with some degree of fairness.