11,863 views
41 votes
41 votes

Which of the following need not necessarily be saved on a context switch between processes?

  1. General purpose registers
  2. Translation look-aside buffer
  3. Program counter
  4. All of the above

6 Answers

Best answer
62 votes
62 votes

Answer: (B)

We don't need to save TLB or cache to ensure correct program resumption. They are just bonus for ensuring better performance. But PC, stack and registers must be saved as otherwise program cannot resume.

edited by
28 votes
28 votes

Answer is B).

TLS buffer need not be saved as it will flush out the contents of the switched process and will have the new process contents.

Stack pointer is saved as switched process might have called a procedure and the suddenly, it was switched.

General purpose registor have contents of ALU data to be computed and hence should be saved.

Program counter , no doubt is neccessary to be saved to keep the progress of the program

Answer:

Related questions

23 votes
23 votes
1 answer
1
Kathleen asked Oct 9, 2014
5,623 views
A critical section is a program segmentwhich should run in a certain amount of timewhich avoids deadlockswhere shared resources are accessedwhich must be enclosed by a pa...
29 votes
29 votes
2 answers
2
Kathleen asked Sep 14, 2014
14,916 views
The value of $j$ at the end of the execution of the following C program:int incr (int i) { static int count = 0; count = count + i; return (count); } main () { int i, j; ...
35 votes
35 votes
5 answers
3
34 votes
34 votes
3 answers
4
Kathleen asked Sep 29, 2014
10,944 views
Dirty bit for a page in a page tablehelps avoid unnecessary writes on a paging devicehelps maintain LRU informationallows only read on a pageNone of the above