[Haskell-cafe] Non-strict evaluation and concurrency (STM) : conflict?

Romain Demeyer romain.demeyer at gmail.com
Tue Sep 28 10:38:45 EDT 2010

Thanks for your help. It's more clear now.

> The value is not being evaluated by STM at all, as your STM functions
> don't need the value.  In your program is evaluating when you print
> the answer in the main thread, as printing requires the value of the
> computation.  If you didn't print, nothing would be computed at all.
> Lazy =).

Does it means that the value is computed *by* the "caller", based on the
thunk, and not by the worker itself?
In this case, in this specific example, it would mean that this program does
not exploit the parallelism at all (except using deepseq or seq).
I understand the principles (lazy evaluation, thunk,...) , but I'm surprised
that no work has been done to "solve" this problem (in the sense that it's
not intuitive to write concurrent programs in this context).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100928/b6142ffa/attachment.html

More information about the Haskell-Cafe mailing list