Information Technology Reference
In-Depth Information
bank at the same time. If these transactions are processed in parallel, the fol
lowing steps might occur concurrently:
Processing Husband's Request
Processing Wife's Request
1. Determine old balance ($600).
1. Determine old balance ($600).
2. Deduct the $50 withdrawal.
2. Deduct the $50 withdrawal.
3. Record the new balance ($550).
3. Record the new balance ($550).
In this case, because the two requests were processed at the same time, work
started on each request with the same balance ($600), and the final balance
given for each request was the same ($550). Thus, each person received $50,
for a total of $100, but only $50 was deducted from the account.
This simple example is typical of the troubles that can arise when multiple
transactions are to be processed at the same time. For each transaction, work
may be straightforward, but complications can arise when several tasks occur
simultaneously. In the banking example, there was no way to anticipate which
spouse would make the withdrawal request first. Thus, the banks (and their
programmers) could not anticipate what sequence to follow in the processing;
indeed, it may happen that different sequences would need to be followed on
different days.
To generalize somewhat, we can consider printers, main mem
ory, and files as resources within a computer system. Our examples
of printing, memory, and banking then illustrate circumstances in
which several tasks seek to utilize common resources at the same
time. In such cases, it may be necessary to place constraints upon al
location of these resources—when and how data are accessed and
what processing is done when and where. Once these constraints
are determined, the operating system is responsible for coordinating
transactions and enforcing constraints.
To accomplish this coordination, the operating system has final
control over the allocation of resources. When a task wants access
to memory, when a user wants to print, or when several users want
to work with the same file(s), programs translate such desires into
Search WWH ::




Custom Search