GATE CSE 2000 | Question: 1.20, ISRO2008-47
in Operating System
8,695 views
35 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
in Operating System
8.7k views

1 comment

please reupload the image or mention the question number
0

Subscribe to GO Classes for GATE CSE 2022

6 Answers

53 votes
 
Best answer

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
23 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

by
7 votes
3 votes
0 votes
→ Actually TLB (or) Cache memory is to ensure correct program resumption.
→ With TLB (or) Cache memory we can get better performance but not mandatory.
→ Program counter, stack, I/O status information and registers must be saved on a context switch between processes.
0 votes

Answer: (B)

TLB data is not necessary to save in memory. Let TLB load automatically on TLB misses. Because it take almost same time as we manually save TLB data on context switch and again load TLB data when execution resumes

Answer:

Related questions