This preview shows page 1. Sign up to view the full content.
Unformatted text preview: it also enters a waiting state because
no tape drive is presently available.
From now on, Pi and P2 will wait for each other indefinitely, since Pi will not
release 7) until it gets T2 to carry out its designated task, that is, not until P 2 has
released T2, whereas P2 will not release T2 until it gets 7). Therefore, the two
processes are in a state of deadlock. Note that the requests made by the two
processes are totally legal because each is requesting for only two tape drives,
which is the total number of tape drives available in the system. However, the
deadlock problem occurs because the total requests of both processes exceed the
total number of units for the tape drive and the resource allocation policy is such
that it immediately allocates a resource on request if the resource is free.
Spooling stands for Simultaneous Peripheral Operation On-Line. It is a
mechanism to deal with the following issues:
1. To reduce the speed mismatch between slow I/O devices and CPU for better
utilization of the-CPU.
2. To convert mutually exclusive I/O devices into non-mutually exclusive I/O
devices so that they can be simultaneously used by multiple processes in a
How spooling helps in dealing with these issues is explained below.
Dealing with Speed Mismatch
The speed mismatch between a slow I/O device such as a printer and the CPU is
normally of the order of few thousand. Thus, while a slow I/O device is
inputting/outputting a few bytes to/from the main memory, the CPU can perform
several thousands of operations. As a result, during reading/writing of data from/to
memory, the CPU is idle for a large percentage of I/O time. Spooling reduces the
idle time of the CPU by placing all data that comes from an input device or goes to
an output device on a magnetic disk (see Figure 14.27). The primary reason for
doing this is to keep the program and data readily available to the fast and
expensive CPU on a high speed I/O medium such as a disk. Reading/writing o...
View Full Document
- Spring '14