[GHC] #11713: STM Finalizers

GHC ghc-devs at haskell.org
Wed Mar 16 14:43:28 UTC 2016


#11713: STM Finalizers
-------------------------------------+-------------------------------------
        Reporter:  mc.schroeder      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Runtime System    |              Version:  8.1
      Resolution:                    |             Keywords:
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 simonpj):

 (2) looks as if it'd impose some pretty heavy constraints on the
 implementation.   To implement it you have to hold locks on all the TVars
 from the transaction (to satisfy (1)).  These would usually be held only
 very briefly.   But the IO action could do anything, including more
 transactions.  Which could take arbitrarily long, and themselves would
 deadlock if they affect any of those TVars.

 A multi-CAS implementation for transaction commit would not work any more.

 I'm unconvinced.

 I've always wanted some `onRetry` thing that would run a specified IO
 action if transaction retries, to allow users to check for starvation and
 take evasive action.

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


More information about the ghc-tickets mailing list