By circular wait, we mean that there exists some chain of processes waiting for resources such that one
process waits for another, which waits for another, etc., until the last process waits for the first again. In the
example, there are only two processes, and each waits for the other, so the circular wait is a short chain and easy
to discern. If, on the other hand, process B blocked waiting for some resource held by process C, and C could
eventually complete and release the resource required by process B, there would be no circular wait, and the
deadlock would not occur.
Deadlock prevention
Deadlocks may be prevented by insuring that at least one of the conditions necessary for deadlock cannot
occur. While this sounds straightforward at first, applying this idea is often impractical.
Suppose one decides to do away with mutually exclusive access to resources? What if two processes use
the printer at the same time? Some real-time systems allow such things to occur because the operating system
is so simplified and streamlined for real-time performance that no provision is made for exclusive access to I/O
devices. The result is that the lines of output from two simultaneously executing processes get intermingled,
leading to unintelligible output on the printer.
Pages:
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302