mutex
is just an integer in memory. But how it works?
- atomic
- memory barrier
- system call
1.https://mortoray.com/2019/02/20/how-does-a-mutex-work-what-does-it-cost/
2. https://preshing.com/20150402/you-can-do-any-kind-of-atomic-read-modify-write-operation/
3. https://eli.thegreenplace.net/2018/basics-of-futexes/