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

2010-09-28 Thread Romain Demeyer
Hi, I'm working on Concurrent Haskell, especially with the monad STM. I don't fully understand the way my program is executed. I think the lazy evaluation leads to a loss of performance, if we don't pay attention to this problem. A short example will be more explicit : Imagine this scenario : we

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

2010-09-28 Thread Romain Demeyer
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