Skip to Main Content
Operating Systems: Concurrent and Distributed Software Design
book

Operating Systems: Concurrent and Distributed Software Design

by Jean Bacon, Tim Harris
March 2003
Intermediate to advanced content levelIntermediate to advanced
912 pages
27h 17m
English
Pearson Business
Content preview from Operating Systems: Concurrent and Distributed Software Design

17.5. Potential problems

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); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Principles of Concurrent and Distributed Programming, Second Edition

Principles of Concurrent and Distributed Programming, Second Edition

M. Ben-Ari
Operating Systems in Depth

Operating Systems in Depth

Thomas W. Doeppner

Publisher Resources

ISBN: 0321117891Purchase book