[GHC] #4001: Implement an atomic readMVar

GHC ghc-devs at haskell.org
Sat Jun 15 05:08:30 CEST 2013


#4001: Implement an atomic readMVar
-------------------------------------------+--------------------------------
    Reporter:  simonmar                    |       Owner:  ezyang          
        Type:  task                        |      Status:  new             
    Priority:  low                         |   Milestone:  7.6.2           
   Component:  Runtime System              |     Version:  6.12.2          
    Keywords:                              |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple            |     Failure:  None/Unknown    
  Difficulty:  Moderate (less than a day)  |    Testcase:                  
   Blockedby:                              |    Blocking:                  
     Related:                              |  
-------------------------------------------+--------------------------------

Comment(by ezyang):

 I thought of a way to remove the extra queue: push reader threads onto the
 front of the ordinary queue, then modify putMVar to loop through the queue
 until it finds a taker. (The invariant is that reader threads are always
 in the front.) Unfortunately, this seems incompatible with arranging for
 the closure to be unlocked before the loop, since we won't know what the
 new head pointer for the MVar should be until we've finished traversing
 the queue.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4001#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list