Skip to content
  • Sylvain Henry's avatar
    f8de456f
    STM: don't create a transaction in the rhs of catchRetry# (#26028) · f8de456f
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    
    
    We don't need to create a transaction for the rhs of (catchRetry#)
    because contrary to the lhs we don't need to abort it on retry. Moreover
    it is particularly harmful if we have code such as (#26028):
    
      let cN = readTVar vN >> retry
          tree = c1 `orElse` (c2 `orElse` (c3 `orElse` ...))
      atomically tree
    
    Because it will stack transactions for the rhss and the read-sets of all
    the transactions will be iteratively merged in O(n^2) after the
    execution of the most nested retry.
    
    This is the second attempt at implementing this. The first attempt
    triggered segfaults (#26291) and has been reverted.
    
    Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
    f8de456f
    STM: don't create a transaction in the rhs of catchRetry# (#26028)
    Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
    
    
    We don't need to create a transaction for the rhs of (catchRetry#)
    because contrary to the lhs we don't need to abort it on retry. Moreover
    it is particularly harmful if we have code such as (#26028):
    
      let cN = readTVar vN >> retry
          tree = c1 `orElse` (c2 `orElse` (c3 `orElse` ...))
      atomically tree
    
    Because it will stack transactions for the rhss and the read-sets of all
    the transactions will be iteratively merged in O(n^2) after the
    execution of the most nested retry.
    
    This is the second attempt at implementing this. The first attempt
    triggered segfaults (#26291) and has been reverted.
    
    Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
Loading