important news: refocusing discussion

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Mar 27 06:13:29 EST 2006


John Goerzen <jgoerzen at complete.org> wrote:

> On Fri, Mar 24, 2006 at 11:07:53AM +0000, Malcolm Wallace wrote:
> >              I assume that since a non-concurrent implementation has
> > only one thread, that thread will be trying to MVar-synchronise with
> > something that does not exist, and hence be blocked for ever.
> 
> Not necessarily.  An MVar is a useful tool in place of an IORef.  It
> works well when a given hunk of code is used in a threaded program,
> but it also works well in a non-threaded program.  If they are used
> correctly, there is no problem.

Your final sentence is the one that I want to emphasise.  What does it
mean to use an MVar "correctly", such that one can avoid blocking in a
non-threaded implementation?

Regards,
    Malcolm


More information about the Haskell-prime mailing list