The requests are served by OS using three simple segments

  1. I/O Traffic Controller: Keeps track of the status of all devices, control units, and communication channels.
  2. I/O scheduler: Executes the policies used by OS to allocate and access the device, control units, and communication channels.
  3. I/O device handler: Serves the device interrupts and heads the transfer of data.

SharedMemorySoham.png

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:

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.

Types of I/O buffering techniques

  1. 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.
  2. Double Buffer: Uses two buffers to allow continuous data transfer between two process or two devices.
  3. 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.