
This message is in three parts: a problem, a solution, and a request for help. The problem is that Control.Concurrent.QSem, QSemN, and SampleVar are all still broken. GHC ticket #3160 is still open [1]. These three synchronization mechanisms can be irretrievable broken by a killThread on a blocked waiter. The solution is that I am please to announce that SafeSemaphore has been updated to 0.9.0 on hackage [2] and github. These provides safe solutions to replace QSem and QSemN, actually several such solutions. See the github [2] page (scroll down for README) for a summary of all the modules. The request for help is that I would like to unbreak the Haskell Platform by replacing the guts of QSem, QSemN, and SampleVar with SafeSemaphore. Do you think my replacement is correct or buggy? Can we get #3160 closed? Replacing these will preserve their API but may tinker with corner case undocumented behavior. Should waiters block in FIFO order? Should QSemN starve big or small requests to be fairer? [1] http://hackage.haskell.org/trac/ghc/ticket/3160 (three years old!) [2] http://hackage.haskell.org/package/SafeSemaphore/ [3] https://github.com/ChrisKuklewicz/SafeSemaphore Sincerely, Chris Kuklewicz

Hi Chris, On Sat, Jun 02, 2012 at 01:22:47PM +0100, Chris Kuklewicz wrote:
The request for help is that I would like to unbreak the Haskell Platform by replacing the guts of QSem, QSemN, and SampleVar with SafeSemaphore.
I think these modules are not being well-cared for in base, so can we solve this by instead removing them from base, and making SafeSemaphore the recommended library for this functionality? The HP can then add the SafeSemaphore package instead if it wants to keep it. We would need to remove: * Control.Concurrent.QSem * Control.Concurrent.QSemN * Control.Concurrent.SampleVar * The Control.Concurrent re-exports of the above 3 modules * Control.Concurrent.mergeIO * Control.Concurrent.nmergeIO Patch attached. Thanks Ian
participants (2)
-
Chris Kuklewicz
-
Ian Lynagh