Futex
Fast Userspace Mutual Exclusive is a kernel feature that helps userspace applications to build MUTEX solutions.
- An application thread calls Futex to remove itself out of scheduling until a wake up call for a specific memory address is received.
- Futex holds an hash map of memory addresses and blocked threads.
- When a second thread which was actually holding the lock updates the memory address value as free, it also calls the Futex with a WAKE_UP command for that specific address.
- Futex then wakes up all threads which were blocked before.
Lock address
This can be any address that's related to the application. For example, it can be the address of a lock property of the object.
