RFC: termination detection for STM

Michael Stahl ms43 at users.sourceforge.net
Thu Feb 15 14:49:13 EST 2007


On Thu, 15 Feb 2007 10:38:53 +0000, Simon Marlow wrote:
> Michael Stahl wrote:
>
>> here is the simplest thing i could come up with that has threads which
>> are blocked indefinitely but not gc'd.
>> 
>> 
> This example isn't deadlocked: it just waits 10 seconds and then
> receives the BlockedIndefinitely exception.  Can you construct an
> example that has a real deadlock that isn't detected?
 
yes, this is indeed not a deadlock. however, it is pretty much the
termination condition which i want to detect. the main thread prevents the
other threads from being gc'd, but the main thread will never cause any
blocked thread to wake up, and of course the ghc rts cannot divine this
fact.
imagine some operation in place of the delay that returns exactly when all
of the spawned threads are blocked. that is the awaitTermination which i
have proposed. now it may well be that this is too much of an
application-specific hack. all i can say is that i cannot see how to solve
the specific problem i am having with BlockedIndefinitely.

	michael stahl

-- 
"There seems to be a long period of initial obscurity for any new
 language. Then after that comes a long period of semi-obscurity,
 followed by total obscurity." -- Paul Bissex



More information about the Glasgow-haskell-users mailing list