Thu Feb 9 04:30:56 PST 2006 Simon Marlow <[EMAIL PROTECTED]>
* improvement to the deadlock detection
When the RTS is idle, as detected by the timer signal, instead of
prodding capabilities from the signal handler (which is not
guaranteed
to work - pthread_cond_signal() can't be called from signal
handlers),
create a new thread to do it.
M ./ghc/rts/Timer.c -6 +22
I am pretty convinced that pthread_create has a lower chance of
working than pthread_cond_signal, as pthread_create has to allocate
memory, which is absolutely taboo in signal headers.
A library function that accesses a data structure that is also used
by the thread that is interrupted by signal will fail, either because
it observes an inconsistent state of the data (for non-thread-safe
libraries), or because it deadlocks waiting for the interrupted
thread to release a lock.
What about using our good old pipe to the IO manager?
Cheers,
Wolfgang
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc