The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+18 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


asked in Operating System by Veteran (68.8k points) | 2k views
please reupload the image or mention the question number

4 Answers

+28 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.
answered by Veteran (35.9k points)
+14 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

answered by Veteran (51.3k points)
+5 votes
answered by Veteran (44.3k points)
+2 votes
answered by Veteran (49.1k points)

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,470 questions
39,199 answers
36,575 users