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

4 Answers

+35 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 (34k points)
edited by
+16 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.5k points)
+5 votes
answered by Boss (45.4k points)
+3 votes
answered by Veteran (55.6k 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

44,236 questions
49,719 answers
65,834 users