-
Good Fences Make Great Concurrent Code: Implementing Dekker’s Algorithm on an x86/x64 Machine
If Dekker’s algorithm is new to you, you might want to start with my previous blog post here first: Mutual Exclusion: No You Don’t Need Atomic Operations to Build a Lock In C. As a very short recap, Dekker’s algorithm provides mutual exclusion between two threads wherein one thread and only one thread can enter…
-
Mutual Exclusion: No, You Don’t Need Atomic Operations to Build a Lock in C
On one of the C programming subreddits today I saw that some people were under the impression that in order to build a mutex in C, atomic operations must be used. There’s a performance argument to be made that atomic operations should be used for this kind of work, but functionally this is flat out…