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.
.



Relevant Pages

  • Re: How to programmatically avoid deadlock?
    ... There are four necessary conditions for deadlock to appear: ... Condition of waiting (threads hold some owned resource and wait to ... A non-blocking wait (where the thread can do other things while waiting) ...
    (comp.programming.threads)
  • Re: How to programmatically avoid deadlock?
    ... before the wait for the 'other' resource is resolved. ... splitting computation in a vat into "turns" which occur in response to ... versatile parallel programming technique helps me to ... understand that deadlock situation is fully natural, ...
    (comp.programming.threads)
  • Re: Deadlock im Recht
    ... Schön, mal wieder davon zu hören, kenn ich noch aus den Vorlesungen. ... Deadlock: ... Conditions for Resource Deadlock ... At most 1 KLT is in its CS ...
    (de.soc.recht.misc)
  • Re: detect deadlock
    ... E.g. your application may block on external input or two threads may have a deadlock while others are still running. ... other's resource, even I created a deadlock situation on purpose. ... You have to track the dependency tree of each waiting thread. ... Unfortunately it is not sufficient to track dependencies only of the threads of one process, because the dependency might involve resources of other programs or the system. ...
    (comp.programming.threads)
  • Re: Prevents Events From Interrupting Events
    ... But since that's pretty obvious and since you're still asking the question, I'm assuming you don't have complete control over the events. ... it cannot move and I get a deadlock. ... then you also need to design your architecture so that you don't have one thread trying to get a resource another already has while that other thread is trying to get the resource the first thread already has. ... The delegate type does in fact make this potentially easier, since you can either create your own queue of delegates with an object array for the parameters and process it yourself, or take advantage of the Control.BeginInvokemethod to queue execution of delegates on a very specific thread. ...
    (microsoft.public.dotnet.languages.csharp)

Loading