[GHC] #2028: STM slightly conservative on write-only transactions
GHC
trac at galois.com
Wed Jan 9 11:26:13 EST 2008
#2028: STM slightly conservative on write-only transactions
--------------------------+-------------------------------------------------
Reporter: JulesBean | Owner:
Type: proposal | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.1
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
--------------------------+-------------------------------------------------
The STM appears to be slightly too conservative on write-only
transactions.
It will store a copy of the current (that is, old) value on a writeTVar,
even if it was never read from. This can cause a spurious retry.
E.g. {{{atomically $ writeTVar tv 0}}} really has no reason to ever retry.
Neither, in fact, does {{{atomically $ mapM (\tv -> writeTVar tv 0)
[tv1,tv2,tv3,tv4]}}}.
My suggestion is to instead indicate "no prior value" for that TVar, and
then make no consistency checks on TVars marked as no prior value...
Jules
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2028>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list