March 2003
Intermediate to advanced
912 pages
27h 17m
English
We shall use the simple example of Section 17.3.2 to illustrate the problems that can occur during concurrent execution of composite operations and some approaches to their solution. Suppose:
process P executes transfer (account-A, account-B, £1000)
process Q executes transfer (account-B, account-A, £200)
In more detail:
| P: | debit (account-A, £1000); | credit (account-B, £1000) |
| Q: | debit (account-B, £200); | credit (account-A, £200 |
Showing more detail of a possible implementation for P (Q is similar):
| P: | debit (account-A, £1000);
read the value of account-A check whether the debit can be made (value ≥ £1000), if not give an error response, otherwise write the debited value as the new value of account-A |
| P: | credit (account-B, £1000); ... |