Dekker
This crate provides an implementation of Dekker's algorithm. Dekker's algorithm is the first known correct solution to the mutual exclusion problem in concurrent programming.
Example
use Dekker;
use thread;
A possible output looks like this:
Incrementing in main thread.
Incrementing in secondary thread.
Incrementing in secondary thread.
Incrementing in main thread.
Incrementing in secondary thread.
Incrementing in main thread.
Incrementing in main thread.
Incrementing in secondary thread.
Incrementing in secondary thread.
Incrementing in main thread.
The counter is now at 10.
In the end, the counter will always be at 10.