[Haskell-cafe] Re: Waiting for thread to finish

Brad Clow brad at bjclow.org
Tue Nov 27 20:47:28 EST 2007


On Nov 28, 2007 11:30 AM, Matthew Brecknell <haskell at brecknell.org> wrote:
> Even with threads, results are evaluated only when they are needed (or
> when forced by a strictness annotation). So the thread that needs a
> result (or forces it) first will be the one to evaluate it.

So does GHC implement some sychronisation given that a mutation is
occuring under the covers, ie. the thunk is being replaced by the
result?

> Did you see Don's strict-concurrency announcement yesterday?
>
> http://www.haskell.org/pipermail/haskell-cafe/2007-November/035292.html

Yes. I am using a TVar to build results of forked functions in. I had
a quick go at changing to channels so I could use Dons library but
kept getting blocking exceptions, so I have left it as is for the
moment.

Regards
brad

-- 
www.scoodi.com
Recycle is good: Reuse is better


More information about the Haskell-Cafe mailing list