[Haskell-cafe] Efficient mutable arrays in STM
David Barbour
dmbarbour at gmail.com
Mon Oct 31 02:31:32 CET 2011
On Sun, Oct 30, 2011 at 6:20 PM, Ben Franksen <ben.franksen at online.de>wrote:
> According to the original STM paper the implementation does an equality
> test, albeit only for pointer equality.
It strikes me as bad form to depend on characteristics of `the
implementation`.
An incremented integer would probably be ok, (no need to evaluate it,
since the closure is newly allocated, thus a new object)
Evaluation would be necessary to avoid a subtle space-leak with laziness
semantics. The size of the closure is potentially linear with the number of
allocations.
A little more on the safe side is a new TVar
>
That works too.
Regards,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111030/703b9606/attachment.htm>
More information about the Haskell-Cafe
mailing list