I am trying to find an algorithm that detects deadlocks in concurrent transactions in a software. I have tried googling but have not found anything. Can someone point be to a good resource to follow on the subject or can someone explain this algorithm?
A:
Detecting deadlock implies some knowledge of the resources that are being acquired. In the simpler cases a single resource manager (such as a database) owns the resources (such as locks on records) and so can detect a cycle in lock requests. Hence the algorithms such as those discussed here can be applied.
In the case of two concurrent transactions, taking locks on arbitrary resources I don't see how we can do this without a "supervisor" view of all the locks that are being taken. If we have that supervisory view then we can apply the algorithms referenced earlier.
Primarily we are looking for cycles in the resourece reaquirements. This is an outline of an approach.
djna
2009-11-25 08:01:21
can you point me to a good resource for the case of a database single resource manager the Bankers algorithms and Ostrich don't work from this case as i recall.
persistence
2009-11-25 08:59:33
You want the cycle detection approach. Afraid I don't know of any example implementation. The reference I added above describes the algorithm.
djna
2009-11-25 18:29:11