in Operating System edited by
4,051 views
8 votes
8 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. Stack pointer
in Operating System edited by
4.1k views

1 comment

How general-purpose register is saved?
0
0

2 Answers

13 votes
13 votes
Best answer

Translation look-aside buffer

In a process context switch, the state of the first process must be saved somehow, so that, when the scheduler gets back to the execution of the first process, it can restore this state and continue.The state of the process includes all the registers that the process may be using, especially the program counter, plus any other operating system specific data that may be necessary.A Translation look-aside buffer (TLB) is a CPU cache that memory management hardware uses to improve virtual address translation speed. A TLB has a fixed number of slots that contain page table entries, which map virtual addresses to physical addresses. On a context switch, some TLB entries can become invalid, since the virtual-to-physical mapping is different. The simplest strategy to deal with this is to completely flush the TLB.

Option B is correct.

selected by
0 votes
0 votes

During context switching PC,Stack and register content must be saved to resume the suspended process.There are other overheads generated by a process-switch that are not strictly part of the switch like extra cache-flushes i.e TLB..correct answer is B

Answer:

Related questions