[GHC] #10841: Run handler on STM retry

GHC ghc-devs at haskell.org
Tue Sep 8 23:53:53 UTC 2015


#10841: Run handler on STM retry
-------------------------------------+-------------------------------------
        Reporter:  shlevy            |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  libraries         |                 Version:  7.10.2
  (other)                            |
      Resolution:                    |                Keywords:  stm
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by fryguybob):

 I don't think it is terribly difficult to implement something like this.
 The retry handler would be stuffed on the atomically frame and when
 `retry` reaches that frame it could easily be executed instead of
 blocking.  I do wonder though if such a thing can be used effectively and
 what additional information would make it more effective.  Can anyone shed
 some light on what particular deficiency in STM or STM applications leads
 to wanting this?

 I can imagine some other information that could make `retry` align better
 with intentions like a version of `retry` to invoke when the condition
 encountered is rare and expected to be resolved quickly making it harder
 to starve due to a round trip through the scheduler.  Your application is
 also free to catch `retry` throw an exception instead with any internal
 details of your transaction you want.  You don't get a wake up when a
 `TVar` changes with this option, but you can try again right away run a
 different transaction or delay by some other means.

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


More information about the ghc-tickets mailing list