The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+26 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 (52k points) | 3.4k views
please reupload the image or mention the question number

4 Answers

+38 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 (33.8k points)
edited by
+18 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.2k points)
+5 votes
answered by Boss (45.1k points)
+3 votes
answered by Veteran (59.7k points)

Related questions

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
49,541 questions
54,084 answers
70,995 users