Haskell: thread blocked indefinitely in an STM transaction

后端 未结 1 985
走了就别回头了
走了就别回头了 2021-02-20 10:26

Is there any way to increase a time interval, on the basis of which the RTS decides that thread has blocked indefinitely in an STM transaction? Here is my code:

         


        
相关标签:
1条回答
  • 2021-02-20 11:18

    Daniel Wagner is right. The decision is not made with timeouts. The relevant code in the rts is in Schedule.c

    See the resurrectThreads function for where the exception is thrown. The comment describes that this is only thrown to threads found to be garbage after GC. ezyang described how this worked for mvars: http://blog.ezyang.com/2011/07/blockedindefinitelyonmvar/

    [bad speculation concerning check removed when I checked its source and realized that it was just a simple guard/retry and not what was described in an earlier paper -- oops! I now suspect that Daniel Wagner is correct here as well, and the issue is somehow that the counter isn't being incremented.]

    0 讨论(0)
提交回复
热议问题