[Stackless] Requesting Comments for a Deadlock Detection Module

Andrew Francis andrewfr_ice at yahoo.com
Mon Mar 30 20:40:12 CEST 2009

Hi Christian:

--- On Sun, 3/29/09, Christian Tismer <tismer at stackless.com> wrote:

> here comes a little input from me about deadlock detection.

Thanks for the comments!

> Yes. This is what I would do pretty differently.
> Not using a register method to be called by hand.
> Instead, I would overwrite the definition of channels
> and modify the channel methods to do the deadlock
> detection.

I thought about wrapping the channel operations. The problem with automatic detection is the system can enter a deadlock before all the resources can be discovered and diagnostics provided.

global ch1
global ch2

def a():
    ch1.send()      <-- blocked at time T
    ch2.receive()   <-- never discovered

def b():
    ch2.send()      <-- blocked at time T + n, now system is deadlocked
    ch1.receive()   <-- never discovered

> Would it be possible to do that traversal incrementally, updating
> on every channel action?

Yes this could be done. I would imagine a DeadlockException could be thrown and it is up to the application in question to figure out what to do. In a system where there is some notion of process (grouping of tasklets), incremental would be a better approach -   'kill' the deadlocked group of tasklets. An individual traversal graph would be smaller too.

> Well, isn't that simple approach sufficient: tracking all actions until >the deadlock occours, and that's about it? Maybe I was too quick with >something :-)

No, you asked similar questions to what I initially asked myself. Since I am just starting, I wanted to keep things simple :-).



More information about the Stackless mailing list