320 views
1 votes
1 votes

Let P1 and P2 are two processes , the Context Switch happens from P1 to P2 .

Meaning : Now what happens is CPU saves the state of P1 and loads the state of P2.

Who raises interrupt to cause a Context Switch?

But where CPU can find all these information ? Is it available in PCB or in Stack?  

1 Answer

1 votes
1 votes
If you consider round robin scheduling algorithm,
each program get a time slice to get executed on CPU.
A timer is used that provide interrupt and indicate that time slice is over.
CPU save the current state of the process and save it and restart another process.

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
3