Hi Bulat, >> I've attached a revised implementation. With my benchmark it gives a >> stack overflow: > > let incRef = atomicModifyIORef r (\a -> (a,a))
That was the problem, I now no longer get a stack overflow. >> As a side note, it's necessary to add parallelStop, to kill all the >> threads - or you get thread blocked exceptions being raised. > > alternatively, you can catch this exception in addWorker I could, but it wouldn't be that easy to tell if the reason for the deadlock was the program finishing a real deadlock occurring in the system. I'd rather not catch exceptions where possible. Thanks Neil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe