Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread Yuras Shumovich
> -- Původní zpráva -- > Od: Corentin Dupont > Datum: 25. 12. 2012 > Předmět: Re: [Haskell-cafe] multi-thread and lazy evaluation > > " > > Great, with me compiled with ghc -threaded the bug shows up. > > However, runnning "main" in ghci do

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread timothyhobbs
aviour has been confirmed? Tim -- Původní zpráva -- Od: Corentin Dupont Datum: 25. 12. 2012 Předmět: Re: [Haskell-cafe] multi-thread and lazy evaluation " Great, with me compiled with ghc -threaded the bug shows up. However, runnning "main" in ghci doesn't show t

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread Corentin Dupont
. I've > narrowed this down and filed a bug report here: > > http://hackage.haskell.org/trac/ghc/ticket/7528 > > Timothy > > -- Původní zpráva -- > Od: Yuras Shumovich > > Datum: 24. 12. 2012 > Předmět: Re: [Haskell-cafe] multi-thread and

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread Corentin Dupont
Hi Brandon, indeed in my example if you add: *b <- evaluate a* after the definition of "a" it works. However, in my original program it doesn't work, I suppose because I interpret the user submitted code (here "*let (a::String) = a" * for the example) via Hint and Hint-server, and the interpretati

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread timothyhobbs
multi-thread and lazy evaluation "On Mon, 2012-12-24 at 16:16 +0100, timothyho...@seznam.cz wrote: > The real question is, does this mean that GHC is stopping the world every > time it puts an MVar? No, GHC rts only locks the MVar itself. See here: http://hackage.haskell.org/trac

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Yuras Shumovich
On Mon, 2012-12-24 at 16:16 +0100, timothyho...@seznam.cz wrote: > The real question is, does this mean that GHC is stopping the world every > time it puts an MVar? No, GHC rts only locks the MVar itself. See here: http://hackage.haskell.org/trac/ghc/browser/rts/PrimOps.cmm#L1358 Yuras ___

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread timothyhobbs
The real question is, does this mean that GHC is stopping the world every time it puts an MVar? Tim -- Původní zpráva -- Od: Brandon Allbery Datum: 24. 12. 2012 Předmět: Re: [Haskell-cafe] multi-thread and lazy evaluation " On Mon, Dec 24, 2012 at 8:45 AM, Corentin D

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Brandon Allbery
On Mon, Dec 24, 2012 at 8:45 AM, Corentin Dupont wrote: > *execBlocking :: MVar (Maybe MyData) -> IO () > execBlocking mv = do >let (a::String) = a >--If you uncomment the next line, it will work >--putStrLn $ show a >putMVar mv (Just $ MyData a "toto")* > It's laziness, yes; you

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Corentin Dupont
Sorry, I'm thinking my example program wasn't maybe too explicit. In it, the line *"let (a::String) = a"* represents the program submitted by the user, that is faulty. The objective is to stop it after some time, and set the (TVar MyData) to its previous value. As you can see, it works only if I pu

[Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Corentin Dupont
Hi all, I have a program where the user can submit his own little programs, which are interpreted using Hint. The user-submitted programs are used to modify a state held in a TVar. As of course those user-submitted programs can't be trusted, I'm trying to protect them, like in Mueval. I installed a