deadlock when two servers call each other - will threads help?

Skip Montanaro skip at
Sat Aug 14 17:58:13 EDT 1999

I'm using XML-RPC as the transport mechanism within a group of database
servers to propagate change information and thus maintain database
consistency.  My servers are logically connected in a tree structure.  Each
server has one parent (except the topmost server) and zero or more
children.  When a change request comes in to a server, if it doesn't come
from the server's parent, it forwards it there.  This allows requests to
come in anywhere in the system, then get percolated through all the servers
by forcing it to travel to the top of the tree, then trickle down.

This is fine in theory, but in practice it yields deadlocks.  A child can be
making an XML-RPC call to its parent to forward one change request at the
same time the parent is trying to make another call to that child.  Both
servers will block in read() waiting for a response that never arrives.
System throughput suffers...

I don't use threads at the moment, but I'm curious whether or not threads
would help here.  Would the blocked read() call allow another thread to run?
If so, I could spawn threads to make RPC calls between servers.


Skip Montanaro	|
skip at  |

More information about the Python-list mailing list