-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
questionFurther information is requestedFurther information is requested
Description
While putting #196 together I noticed this comment:
io-sim/io-sim/src/Control/Monad/IOSim/STM.hs
Lines 156 to 160 in 785dc08
-- NB. lazy: we want the transaction to be | |
-- short, otherwise it will conflict | |
(z:zs) -> do | |
writeTVar queue $! (zs, r', [], w) | |
return (Just z) |
Is this actually true for the code here? This doesn't look like a lazy pattern match to me; forcing the first cons of reverse ys
will force the linear (in the length of zs
) amount of computation as part of the STM
transaction AFAICT. If so, it probably makes sense to either fix this (but it isn't high priority as it isn't used by IO
) or remove the comment.
Also see the upstream readTBQueue
for comparison: https://github.com/haskell/stm/blob/07df1050ab5d45244f718eee8a512bb18e7066f6/Control/Concurrent/STM/TBQueue.hs#L133-L140
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested