mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
If sleepers on a mutex were more than one, only one of them was woken up. This caused the other ones to sleep forever. Now, there is not any facility to check if there are still sleepers on the kernel space when a thread is about to unlock a mutex. To workaround this problem, we started waking up all the threads instead of one. This brings another problem called thundering herd but also provides random fairness which gives more oppurtunity to a higher priority thread to get the lock.