From: Mc Osten Date: 2006-03-12T01:43:44+09:00 Subject: Re: Threads and Deadlocks Eric Hodel ha scritto: > There's nowhere to throw an exception to, all threads are blocked from > running. What happens then? Is there any documentation about this (I'd rather not to read directly the source, but if there is no other way...) > No. The error is in your programming. Terminating a thread won't break > the deadlock because either it is holding a resource other threads are > waiting on or it is waiting on a resource some other thread is using and > sleeping. No. The error is not in my programming since this is no real case. The deadlock is intentionally created in the most obvious way just to see what happened; in this sense the program is correct, it does exaclty what it was meant to: it deadlocks. If I can somehow trap the event that makes the ruby interpreter terminate I could obviously recover the deadlock, since blocked resources would have been constructed to be recoverable. Probably I am not able to explain what I'm looking for: this is not real case programming. This are kind of teaching examples. > It is part of the interpreter and written in C. So I can't assume JRuby (for example) will act the same, can I? > Everybody uses threads in Ruby. Ok.