- Back to Home »
- Buffering and Spooling in Operating System
Buffering and Spooling in Operating System:
Definition and Explanation:
Assume that a process is issuing several I/O calls to transfer a file from the hard disk to the main memory. If all data transfers are un-buffered then each I/O request from the process causes a physical transfer on the appropriate peripheral. The process is blocked on each request.
It is convenient to first transfer all data from the disk to an area in memory called an input buffer at disk speed. In this way, heavy overhead in process switching is avoided. When the buffer is full, the whole amount of data will be transferred to its destination at the speed of the CPU. By this way, the user process only blocks when the buffer is empty. When this occurs the operating system refills the buffer and the process continues.
In the same way, the output transfer from a process to an external device are directed to an output buffer.