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

GHC ghc-devs at haskell.org
Mon Mar 30 19:47:56 UTC 2015


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

 * cc: core-libraries-committee@… (added)


Comment:

 We (PivotCloud) are running up against this problem currently (it is
 causing live-locking in our production code) and are curious if a patch
 would be accepted to make the change described in the ticket (i.e. change
 the case statement to a let binding).

 Incidentally, in Simon Marlowe's book, he explicitly mentions that one
 should use a lazy let here instead of a case statement, but somehow this
 did not make it into the actual implementation of TQueue. See
 http://chimera.labs.oreilly.com/books/1230000000929/ch10.html#CO37-2

 Also, I don't know how releases for STM work---is it plausible that we
 could fix this quickly and get out a new version of STM, or would a better
 path forward for our immediate need be to just make a custom (copy-and-
 paste) version of TQueue with this fix? We are happy to submit a patch in
 either case.

 Thanks!
 Jon Sterling & Lars Kuhtz
 PivotCloud Inc

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


More information about the ghc-tickets mailing list