[GHC] #9539: TQueue can lead to thread starvation

GHC ghc-devs at haskell.org
Sun May 27 22:56:09 UTC 2018


#9539: TQueue can lead to thread starvation
-------------------------------------+-------------------------------------
        Reporter:  jwlato            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  7.8.2
      Resolution:                    |             Keywords:  stm
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Yitz, I ''suspect'' my approach will be somewhat more robust than yours.
 Both should prevent writers from overwhelming readers, but mine should (I
 believe) also prevent the queue from freezing up altogether as a result of
 contention over unrelated `TVar`s. The real-time versions (see especially
 `RTTQueue1`) make this really simple; there's never a giant blob of queue
 maintenance work for ''any'' thread. The amortized version helps more
 subtly, by ensuring that queue maintenance work is "saved" across
 transaction failures through the power of thunk update.

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


More information about the ghc-tickets mailing list