13.07.2015 Views

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

13.1 through 13.5, 13.10 and 13.11

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

474 Chapter 13 Disk Storage, Basic File Structures, <strong>and</strong> HashingFigure 13.3 illustrates how two processes can proceed in parallei. Processes A ancl iiare running concurrently in an interleaved fashion, whereas processes C <strong>and</strong> D ar.lunr.ring concurrently in a parallel fashion. When a singie CPU controls rrultil.i.processes, parallel executiolt is not possible. However, the processes can still rur:concurrently in an ir.rterleaved way. Buffering is most useful when processes can nulconcurrently in a parallel fashion, either becar,rse a separate disk I/O processor i.available or because multiple CPU processors exist.Figure 13.4 illustrates how reading <strong>and</strong> processing can proceed in parallel when thctirne required to process a disk block in mernory is less than the time required t(rread the next block <strong>and</strong> fill a buffer. The CPU can start processing a biock once ir.transfer to main memory is completed; at the same time, the disk I/O processor canbe reading <strong>and</strong> transf'erring the next block into a different buffer. This techniqr.re i:called double buffering <strong>and</strong> can also be used to read a corrtinuous stream of block.Figure 13.3Interleaved concurrencyversus parallel executionlnterleaved concurrencyof operations A <strong>and</strong> BParallel execution ofoperations C <strong>and</strong> DiA',AIIllrBlIrBIIItt.Iit^_-__-|>TimeFigure 13.4Use of two buffers, A <strong>and</strong> B, for readinq from disk,Disk Block:t/o;iFiil At+1FiII Bt+2F|IIAIri+ sFillAt,ri+4Fill ADisk Block:PROCESSING:ll'tt i t i+1i+2lProcessA I ProcessB I ProcessA€lrllIIIIII i+3i Process Bl{.--------------IIIII i+4' Process AlHII______>Time

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

Saved successfully!

Ooh no, something went wrong!