Fail: thread killed

Simon Marlow simonmar@microsoft.com
Thu, 8 Mar 2001 17:34:26 -0000


> Marcin 'Qrczak' Kowalczyk wrote:
> [snip]
> > Since the very purpose of killThread is to kill the damn thread,
> > I find it inconvenient to have to wrap any thread which is supposed
> > to be killable with Exception.catch to avoid the message. Worse:
> > it should use block and unblock, otherwise there is a small window
> > where killing the thread will still display the message.
> [snip]
> I agree with this.  I also find it mildly irritating having to
> catch exceptions to stop GHC informing me that it's just garbage
> collected a thread which is permanently deadlocked.

Ok, so which exceptions should be displayed?

  - Marcin says all async exceptions should be suppressed in
    child threads.

  - George says BlockedOnDeadMVar messages should also be
    suppressed (presumably only on child threads).

any others?

I'm not sure I agree that StackOverflow/HeapOverflow messages should be
suppressed.  It might be really confusing if your program just deadlocks
instead of completing, when what actually happened was one of the child
threads got a stack overflow and died silently.

I can see the point about ThreadKilled though.  There's only one way to
kill a thread, and that's with killThread, so you don't want to see a
message saying the thread was killed (except that the presence of the
message indicates that the thread was alive before it was killed ;-).

Cheers,
	Simon