I find the issue of executing a transaction between two accounts very similar to the problem of dining philosophers. In order to complete a transaction, the thread must block both accounts to ensure that the correct value is debited from one account (first assuring that there are available funds) and credit to the other.
Topology is not quite a round table, but very close. Present 5 bills at the table. In this analogy, accounts are forks. Any two accounts can participate in a transaction. Transactions == Philosophers. Thus, in this example, transactions (philosopher) can not only sit at the edge of the table between two accounts (forks), but also on the line crossing the table, connecting any two accounts (forks).
source
share