-
- Downloads
mutex: fairness
Without fairness, the concurrent alloc/free test fails quickly on smp, as the allocator thread hogs the allocator mutex and quickly exhausts all memory. While we could fix up the test to avoid this, fairness is a desirable quality, so implement it. We do so by adding and owner field, and having the unlocker transfer ownership of the locked mutex instead of freeing it and letting the waiter race with a newcomer. Also simplify the wait list to a singly linked list. There was some corruption with the original implementation, and rather than fix it, simplify it to a singly linked list which is all that is needed.
Loading
Please register or sign in to comment