On 06 July 2004 11:29, Conor T McBride wrote:
> OK, here's what I want, what I do with it, and my attempt to deliver
> it. But I'm not an expert, so please let me know if there's some
> disastrous flaw...
>
> The signature/spec:
>
> type Hole x
>
> hole :: IO (Hole x)
>-- returns a fresh em
Hi folks
I had a bit more of a play over the weekend. Got addicted.
Lumps of code further on down.
Jan-Willem Maessen wrote:
>If you're really using MVars in write-once read-many style, the
>semantics of readMVar shouldn't be a problem:
>
>* Before the initializing write, all calls to readMVar bloc
On Friday 02 July 2004 15:59, you wrote:
> > at a guess the magic take put is:
> >
> > block ( do
> > a <- takeMVar x
> > putMVar x a
> > )
> > return a
>
> This doesn't prevent the race condition Conor mentioned. It only
> prevents the thread executing the above code from being interrupted
> by an
Conor T McBride wrote:
... [questions about operation ordering with MVars]
>
I'm only asking, because I'm trying to cook up some kind of partial
evaluator for programs which are being simultaneously edited by
fiercely argumentative devils. Kind of `demonic laziness', where
the computations decide w
> at a guess the magic take put is:
>
> block ( do
> a <- takeMVar x
> putMVar x a
> )
> return a
This doesn't prevent the race condition Conor mentioned. It only prevents
the thread executing the above code from being interrupted by an
asynchronous exception (i.e., Control-C, or another thread
On 02 July 2004 10:16, Conor T McBride wrote:
> Hi folks
>
> I'm having a play with Concurrent Haskell, and came across this in the
> library.
>
>readMVar :: MVar a -> IO a
>This is a combination of takeMVar and putMVar; ie. it takes the
>value from the MVar, puts it back, and also r
at a guess the magic take put is:
block ( do
a <- takeMVar x
putMVar x a
)
return a
Keean.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi folks
I'm having a play with Concurrent Haskell, and came across this in the
library.
readMVar :: MVar a -> IO a
This is a combination of takeMVar and putMVar; ie. it takes the value
from the MVar, puts it back, and also returns it.
I was just wondering if I understand things correctly. Su