The requests are served by OS using three simple segments
- I/O Traffic Controller: Keeps track of the status of all devices, control units, and communication channels.
- I/O scheduler: Executes the policies used by OS to allocate and access the device, control units, and communication channels.
- I/O device handler: Serves the device interrupts and heads the transfer of data.

Scheduling is used for efficient usage of computer resources avoiding deadlock and serving all processes waiting in the queue.
I/O Traffic Controller has 3 main tasks:
- The primary task is to check if there’s at least one path available.
- If there exists more than one path, it must decide which one to select.
- If all paths are occupied, its task is to analyze which path will be available at the earliest.
Buffers
I/O buffering is a technique that involves the temporary storage of data in a buffer, which is a reserved area of memory, to reduce the number of I/O operations and manage the flow of data between fast and slow devices or processes.
- Buffering is done to deal effectively with a speed mismatch between the producer and consumer of the data stream.
- A buffer is produced in the main memory to heap up the bytes received from the modem.
- After receiving the data in the buffer, the data gets transferred to disk from the buffer in a single operation.
- This process of data transfer is not instantaneous, therefore the modem needs another buffer to store additional incoming data.
- When the first buffer is filled, then it is requested to transfer the data to disk.
- The modem then starts filling the additional incoming data in the second buffer while the data in the first buffer gets transferred to the disk.
- When both buffers complete their tasks, then the modem switches back to the first buffer while the data from the second buffer gets transferred to the disk.
- The use of two buffers disintegrates the producer and the consumer of the data, thus minimizing the time requirements between them.
- Buffering also provides variations for devices that have different data transfer sizes.
Types of I/O buffering techniques
- Single Buffer: Uses one buffer to store data temporarily. A buffer is provided by the operating system to the system portion of the main memory.
- Double Buffer: Uses two buffers to allow continuous data transfer between two process or two devices.
- Circular Buffer: When more than two buffers are used, the collection of buffers itself is referred to as a circular buffer.
Caching
Caching in I/O operations is a fundamental technique to improve performance by reducing the need for repetitive slow I/O operations.
Scheduling
I/O Scheduler functions similarly to process schedulers, it allocates the devices, control units, and communication channels. However, under a heavy load of I/O requests, Scheduler must decide what request should be served first and for that we multiple queues to be managed by OS.
The major difference between a process scheduler and an I/O scheduler is that I/O requests are not preempted: Once the channel program has started, it’s allowed to continue to completion. Although it is feasible because programs are relatively short (50 to 100 ms).
Some modern OS allows I/O Scheduler to serve higher priority requests. In simpler words, If an I/O request has higher priority then they are served before other I/O requests with lower priority. The I/O scheduler works in coordination with the I/O traffic controller to keep track of which path is being served for the current I/O request. I/O Device Handler manages the I/O interrupts (if any) and scheduling algorithms.