NVIDIA Interview Question
Software Engineer / DevelopersWhat I can think of is this, it depends on the type of interrupt. If the interrupt is asynchronous, then it goes back to the same process. This is because, when the interrupt came in, the program counter, along with the %esp are stored, on another stack, i.e a stack switch occurs, and these are restored once the ISR is complete.
On the other hand, if this the interrupt is a blocking system call, then the ISR would invoke the scheduler to select the next process....
I can suggest something for hardware interrupts, since I am not aware about OS concepts.
In case of hardware ISR makes sure to save the values of important registers like PC, nPC, Processor State Registers, and other special function registers on to the stack. While returning from the ISR, these values are popped and the state of the processor is regained.
i guess its the process control block[PCB] thats keeps getting pushed on top of stack for each interruption/switch by another process,,, so the moment one process is over the one sitting on TOP of the stack is picked and that is exactly the same process that was running when the request for serving another process come...and this applies recursively upto the last process left in the Stack...similar to function calls in programming languages like C/C++ etc...
- desiNerd July 24, 2009