The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+23 votes
2.7k views

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 (59.5k points) | 2.7k views
0
please reupload the image or mention the question number

4 Answers

+32 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 Boss (34.1k points)
edited by
+15 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 (50.1k points)
+5 votes
answered by Boss (45.2k points)
+2 votes
answered by Veteran (54.9k 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

37,118 questions
44,701 answers
127,279 comments
43,766 users