Re:Do I really want to be using a language where memoize is ...
by jongraehl on Tuesday July 20, 2010 @10:19AM
(#1532118)
That's not generally true, although you can make it work out that way in some cases (I think threads mean that some work may be duplicated).
[ Parent
| on HN ]
Re:Do I really want to be using a language where memoize is ...
by klodolph on Tuesday July 20, 2010 @10:49AM
(#1532219)
Be careful lest thou misunderstand the GHC runtime, which is fairly subtle.
In Haskell, the semantics are unchanged if the runtime evaluates a particular thunk multiple times. Haskell is fairly unique in this regard. For exactly this reason, Haskell threads do not need to synchronize when evaluating thunks in multicore environments. Synchronization has a cost, and that cost can exceed the cost of duplicate evaluation.
It's a trade off.