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

GHC ghc-devs at haskell.org
Tue May 22 23:24:04 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):

 Aha! We ''don't'' necessarily need a real-time queue, but we do need to
 use something more like a ''persistent'' queue. Why? If a transaction does
 queue maintenance work that was deferred before the transaction began
 (e.g., rotating the queue because it arrived in a poor state), we need
 that work to survive even if the transaction itself fails because the
 maintenance work goes on too long. The only way that can happen is through
 laziness: the transaction must be forcing ''pre-existing'' thunks.

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


More information about the ghc-tickets mailing list