[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] scheduling an alarm

Subject: Re: [Haskell-cafe] scheduling an alarm
From: Brian Denheyer
Date: Tue, 26 Jan 2010 22:17:12 -0800
On Tue, 26 Jan 2010 10:54:03 -0800
Thomas DuBuisson <[email protected]> wrote:

> > doEvent f usDelay = forkIO $
> >   threadDelay usDelay
> >   doEvent f usDelay
> >   f

Are you sure that's right ? It seems to be a memory-gobbling infinite
loop...

How about this:


f = putStrLn "foo"

doEvent f usDelay = do forkIO f
                       threadDelay usDelay
                       doEvent f 1000000

main = doEvent f 1000000

which seems to work.  That makes me suspicious :-|


Brian

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>