16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Buffer Cache<br />

Figure 69. Forth Scenario for Buffer Allocation<br />

No buffers available so process goes to sleep.<br />

Figure 70. Race for Free Buffer<br />

.<br />

If process A attempts to read a disk block and<br />

allocates a buffer as in (2), <strong>the</strong>n it will sleep while it<br />

waits for <strong>the</strong> I/O transmission from disk to complete.<br />

While process A sleeps, suppose <strong>the</strong> kernel<br />

schedules a second process B, which tries to access<br />

<strong>the</strong> disk block whose buffer was just locked by<br />

process A.<br />

Figure 71. Fifth Scenario for Buffer Allocation<br />

184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!