Re: Problem with hugs, concurrency and unsafeInterleaveIO (maybe a bug?)

2003-03-16 Thread Alastair Reid
> I am trying to lazily wait an MVar in hugs, in conjunction with > concurrent haskell: > > [code snipped] > > I think that main2 should work, because in evaluating the result of > f2, the main thread should suspend and yield. Hugs creates a fresh scheduler instance for each invocation of unsafeP

Problem with hugs, concurrency and unsafeInterleaveIO (maybe a bug?)

2003-03-15 Thread Nick Name
I am trying to lazily wait an MVar in hugs, in conjunction with concurrent haskell: - import Concurrent import IOExts f = do v <- newEmptyMVar c <- getContents forkIO (putMVar v (head c)) r <- unsafeInterleaveIO (takeMVar v) return v f2 = f >>= unsafeInterleaveIO . takeM