
#9321: Support for waiting on multiple MVars -------------------------------------+------------------------------------- Reporter: schyler | Owner: simonmar Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Runtime | Keywords: mvar System | Operating System: Unknown/Multiple Resolution: | Type of failure: None/Unknown Differential Revisions: | Test Case: Architecture: | Blocking: Unknown/Multiple | Difficulty: Unknown | Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Comment (by schyler): And finally, the motivation. STM gives us many-to-one waiting. Disadvantages of STM: * Does not scale well because it's not fair Advantage of MVar: * It's fair * It's fast Disadvantages of MVar: * To wait on N channels, have to use N extra forks, 2 MVar puts and N+1 total MVar read operations Advantages of MVar multiple waiting support: * To wait on N channels, have to use no extra forks, 1 MVar put and 1 MVar read operation (with N-1 waiter ignores). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9321#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler