628 views
2 votes
2 votes

WHEN A PROCESS GOES FOR IO(INPUT/OUTPUT), A DIFFERENT PROCESS IS SCHEDULED TO A PROCESSOR. DOES IT HAPPEN IN ALL THE THREE IO MODES- INTERRUPT DRIVEN, PROGRAMMED IO AND DMA?? PLEASE CAN ANYONE TELL THIS IN DEPTH.

1 Answer

0 votes
0 votes

Well, that is a really nice question. Let me try to explain as much as I know.

Whenever a process needs to transfer some data from / to an input device, such a operation is known as I/O operation.

  • If the process (of transfer of data from / to device) is performed under the control a program, that is it sets the registers of input / output device, then such a mode is called Programmed I/O. In such a mode, the CPU initiates the (driver) program, to transfer the bytes from / to device. And it waits for the operation to complete. However, the program does not tell CPU that the operation has completed. CPU has to query the status of (certain) registers to get the information. So, CPU has to continously Poll to get the status. This severly degrades the performance of system. 
In short CPU waits while program completes IO.
  • If the process (of transfer of data from / to device) is performed in such a way that after the transfer is complete , the program interrupts CPU to tell that the action is completed, then such a mode is called Interrupt driven I/O. In such case, CPU issues the command for transfer and continues to work on something else. During this time, IO module gets data form device and once it gets, it interrupts CPU. On getting interrupt, CPU transfers data to memory.
In short, CPU is able to do other things while IO in progress
  • If the process (of transfer of data from / to device) is performed in such a way that after the transfer is carried out entirely to memory by device other than CPU, it is called DMA mode. In such a mode, CPU tells DMA that it needs some data from IO device. And then CPU continues doing something else. DMA, interrupts CPU, to get a bus (for memory) to transfer data to / from memory from / to IO. CPU grants bus and then does something else.
In short, CPU is able to do other things here also while IO is in progress. In this mode, CPU performs good.

Request others to add / share insights to this

Related questions

1 votes
1 votes
1 answer
1
iarnav asked Jan 12, 2022
406 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
1 votes
1 votes
1 answer
2
jayadev asked Oct 10, 2021
1,287 views
in round robin algorithm if a process with burst time = 10 arrived at t=0 and time quantum is 2 units, context switch time is 2 units . Then completion time of the proces...
0 votes
0 votes
1 answer
3
iarnav asked Jul 17, 2018
852 views
Let's say we have four processes as (P1, P2, P3, P4) and have Arrival time as (0,1,2,3) respectively, but all of them has same CPU Burst time as (10ms) then does SRTF wil...
2 votes
2 votes
1 answer
4
_jerry asked Jan 26, 2018
654 views
How are user level threads scheduled?