Ticket #2028 (new bug)
STM slightly conservative on write-only transactions
| Reported by: | JulesBean | Owned by: | |
|---|---|---|---|
| Priority: | lowest | Milestone: | 7.6.2 |
| Component: | Compiler | Version: | 6.8.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Runtime performance bug | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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
Change History
Note: See
TracTickets for help on using
tickets.
