566 views
0 votes
0 votes

when execution of one process is completed and other process is scheduled , Is it called Context switch ?

I think , It is not Context switch, as according to wiki

In computing, a context switch is the process of storing the state of a process or of a thread, so that it can be restored and execution resumed from the same point later. This allows multiple processes to share a single CPU, and is an essential feature of a multitasking operating system.

As we are not storing results od earlier process for later execution. If there are any results produced by some operation within process or program , It is responsibility of program (or process when it running) to store them back.

For example : when C program to add two number gets converted to Assembly language code , It also has instruction to store result of addition back into memory.

Hence answer to this previous year gate question must be 0

http://gateoverflow.in/885/gate2006-06-isro2009-14 

1 Answer

0 votes
0 votes
The answer to your question is yes. It is not like the regular context switch where the state of the process will be saved as here there is no need to save the state of the completed process. The new process state has to be loaded though. Hence, it is still a context switch.

The system might save the state of the terminated/completed process too and later decide to discard it. However, that depends on the implementation.

Related questions

0 votes
0 votes
0 answers
2
Piyush151099 asked Dec 1, 2018
247 views
1 votes
1 votes
0 answers
3
anisha007 asked Sep 25, 2018
721 views
What is the least number of context switching required for 'n' number of processes?
0 votes
0 votes
0 answers
4
Purvi Agrawal asked Sep 14, 2017
513 views
Where is the PCB and the process saved in the main memory when context switch takes place ?