2 ms·
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).
by jongraehl 16y ago
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).
- klodolph 16y agoBe 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.