Context switching and interrupts

71 Views Asked by At

I have a question related to context switching and interrupts. Since on the internet, different sources gave me different answers for it, I got confused a bit. For every interrupt do I need to put 2 contexts switching 1 at the beginning of the interrupt and the second at the end of the interrupt even though I am not changing the process? Some sources tell me "If there is no change in the process, there is no need for context switching." but some other say "A context switch is required for every interrupt and every task that the scheduler picks."

I was trying to understand FCFS concept. For example I have a process Px it arrived at time 2 and at time 3 there is an interrupt and interrupt takes 2 time slots. So it will go back to process Px at time 5. And I know context switch takes 2 time slots as well. Should I add any context switch time to it because of interrupt or since the process doesnt change to Px to Py or another process different than Px, I shoudn't add context switching time?

0

There are 0 best solutions below