Describe buffering in the I/O subsystem of an operating system. Give reasons why it is
required, and give a case where it is an advantage, and a case where it is a disadvantage
Answer:
-Buffering is the action I/O devices take in order to efficiently transfer data to or from the operating system. Instead of directly transferring data bit-by-bit (literally) via system calls and registers, which is slow and requires context switch after context switch, we fill a buffer (or two, or three) with data, which is periodically transferred to or from main program control. We can also perform double or triple buffering
where two-way efficiency is gained. It can be advantageous when we need to transfer large volumes of data, and at the same time may be disadvantageous due to overheads – if the network is high-speed the time to copy between buffers might be comparable to the time spent actually transferring the data