Ticket #2319 (closed merge: fixed)
STM not as fair as it could be
|Reported by:||josef||Owned by:||igloo|
|Type of failure:||Difficulty:||Unknown|
|Test Case:||Blocked By:|
Even though this has been discussed via email I'm filing a ticket so that the issue and the patch aren't forgotten about. If the patch is accepted it would be nice if it could be included in 6.8.3 provided it merges cleanly.
GHC's STM implementation could be a bit more fair. Suppose you have several transactions waiting for a variable to be updated. When that variable is updated all transactions are woken up. The problem is that the transaction which was blocked last is woken up first. This leads to unnecessary starvation in some programs.
There is a patch which fixes this. It can be downloaded from here: http://www.haskell.org/pipermail/cvs-ghc/2008-April/041943.html