
23 Mar
2010
23 Mar
'10
6:31 p.m.
I tried a few things. First I added another timeout to main, so the program kills itself after a few seconds. doit :: IO (Maybe ()) doit = timeout 12000000 $ {- yield >> -} return () main :: IO () main = do _ <- timeout 5000000 $ forever doit return () This program failed to terminate. But when I compiled -with threaded and added a yield to doit, it worked (kinda). If the timeout in doit is not too long, like 200 milliseconds, the program has constant space usage. But when I increased the timeout in doit to 12 seconds I got a stack overflow. I'll investigate further when I have more time. Regards, Roel