[GHC] #7104: Add tryWriteTBQueue to Control.Concurrent.STM.TBQueue

GHC cvs-ghc at haskell.org
Thu Aug 2 10:04:01 CEST 2012


#7104: Add tryWriteTBQueue to Control.Concurrent.STM.TBQueue
----------------------------------+-----------------------------------------
    Reporter:  joeyadams          |       Owner:                  
        Type:  feature request    |      Status:  new             
    Priority:  normal             |   Milestone:                  
   Component:  libraries (other)  |     Version:  7.4.2           
    Keywords:  stm                |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple   |     Failure:  None/Unknown    
  Difficulty:  Unknown            |    Testcase:                  
   Blockedby:                     |    Blocking:                  
     Related:                     |  
----------------------------------+-----------------------------------------
Changes (by simonmar):

  * difficulty:  => Unknown


Comment:

 Replying to [ticket:7104 joeyadams]:

 >  * Is {{{atomically (retry `orElse` return ())}}} guaranteed to not be
 interruptible by an asynchronous exception when exceptions are masked?

 Yes.

 >  * Is there a performance benefit to avoiding retry when possible?  I'd
 imagine not, since this should only involve throwing away a few
 transaction log entries.

 I haven't measured it, but I would guess that coding the try* functions in
 terms of the blocking versions using a retry/orElse combination is more
 expensive than coding them directly.  (you could measure it - there's a
 benchmark program in `stm/bench/chanbench.hs`).

 I'd like to know whether your patch to add `tryWriteTBQueue` affects the
 performance of `writeTBQueue`, but I don't have time to test it right now.

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



More information about the Glasgow-haskell-bugs mailing list