Re: how to catch GHC no threads to run exception?

2002-08-02 Thread Volker Stolz
In local.haskell, you wrote: Since I have 3 threads waiting on takeMVar, do I have to wrap all of them with Exception.catch? Yes. Especially since ghc-5.04, you cannot be sure which of the blocked threads will get killed first:

how to catch GHC no threads to run exception?

2002-08-01 Thread paul
My program runs 3 threads, and after a few minutes' execution all threads come to a state that they all wait on some MVars, then the program halts with an error: test: no threads to run: infinite loop or deadlock? (test is my program name) My problem is that this behavior is actually desired,

Re: how to catch GHC no threads to run exception?

2002-08-01 Thread Volker Stolz
In local.haskell, you wrote: test: no threads to run: infinite loop or deadlock? My problem is that this behavior is actually desired, but how do I catch this exception and do some bookkeeping (closing external IO, etc.) and then a proper exit? You can wrap the `takeMVar' with

Re: how to catch GHC no threads to run exception?

2002-08-01 Thread paul
On Thu, Aug 01, 2002 at 11:27:06AM +0200, Volker Stolz wrote: In local.haskell, you wrote: test: no threads to run: infinite loop or deadlock? My problem is that this behavior is actually desired, but how do I catch this exception and do some bookkeeping (closing external IO, etc.) and