Buffer Management – Buffer ? – System I O



Buffer Management – Buffer ? – System I O

0 1


buffer-file-org-slides

Buffer presentation in file organization class.

On Github jangm / buffer-file-org-slides

Buffer Management

Jan Maghuyop / buffer-file-org-slides

Buffer ?

Buffer is a place in memory that accumulates large chunks of data to be later written to disk as a chunk .

Buffering means working with large chunks of data in main memory so the number of accesses to secondary storage is reduced .

Buffer vs Cache

System I O

System I / O Buffers are beyond control of application programs and are manipulated by the Operating System .

Secondary Storage ⬌ Buffer ⬌ Program

Disk ⬌ RAM ⬌ Executable

Bottlenecks

							
while (1) {
	infile >> ch;
	if (infile.fail()) break;
	outfile << ch;
}
							
						

Management ?

Double Buffering

Two buffers can be used to allow processing and I/O to overlap.

Multiple Buffering

Multiple buffers can be used to allow processing and I/O to overlap.

Buffer Pooling

Pool of buffers, Requests for a sector, O.S looks if sector is in some buffer, Brings sector to free buffer, If not LRU is used.

Move Mode

Program's data area ⬌ System buffer ⬌ Disk

System & program buffers is used. Moving data from one place in RAM to another before they can be accessed, Unnecessary.

Locate Mode

System or program buffer only, performs I/O directly between secondary storage and program buffer, System buffers handle all I/Os, program uses locations through pointer variable.

End.

Questions ?