2 ms·
One possibility is if it's not about inherently "fast" or "slow" processes. Suppose all of the processes are doing very similar asynchronous or network I/O, and
by tbrownaw 7y ago
One possibility is if it's not about inherently "fast" or "slow" processes. Suppose all of the processes are doing very similar asynchronous or network I/O, and need the lock at roughly set wall-clock intervals. Say 100ms, to have numbers to play with.
In that case, you can dequeue something that's been waiting for 90ms and it will re-enqueue itself after another 10ms, or you can dequeue something that's been waiting for 10ms and it won't re-enqueue itself for another 90ms. In which case, FIFO would mean that processes are doing more of their waiting in the lock queue (and being woken up every time the lock changes hands), while LIFO or random order would put more of their wait time blocked on IO. Random wouldn't be as good as LIFO, but it wouldn't have nearly as high a risk of starvation.