Is this a bug in multithreading code?
Nick Name
nick.name@inwind.it
Wed, 23 Apr 2003 15:51:25 +0200
Hi all, does someone know why this program works
------------------------
import Concurrent
loopM = sequence_ . repeat
main = do
v <- newMVar 0
forkIO (loopM (modifyMVar_ v (return . (1+))))
-- forkIO (loopM (modifyMVar_ v (return . (1+))))
loopM (readMVar v >>= print)
-------------------------
but uncommenting the commented line makes the program fail with "stack
overflow" ?
Thanks for help
Vincenzo