Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following need not necessarily b... Start Learning for Free
Which of the following need not necessarily be saved on a context switch between processes?
  • a)
    General purpose registers
  • b)
    Translation look aside buffer
  • c)
    Program counter
  • d)
    All of the above
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
Which of the following need not necessarily be saved on a context swit...
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 lookaside 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. 
Free Test
Community Answer
Which of the following need not necessarily be saved on a context swit...
Context Switch

A context switch is the process of saving the current state of a process and restoring the state of another process. It occurs when the operating system decides to switch the execution from one process to another. This allows multiple processes to share the CPU and execute concurrently.

What needs to be saved on a context switch?

During a context switch, several components of the process need to be saved so that the state of the process can be restored later. These components include:

1. General Purpose Registers: General purpose registers store the values of variables and intermediate results during the execution of a process. These include registers like AX, BX, CX, etc. The values in these registers must be saved during a context switch to ensure that the process can resume execution from where it left off.

2. Program Counter: The program counter (PC) holds the memory address of the next instruction to be executed. It keeps track of the current position in the program. Saving the program counter is crucial during a context switch as it allows the process to resume execution from the correct instruction.

3. Translation Lookaside Buffer: The Translation Lookaside Buffer (TLB) is a cache used for storing recently accessed page table entries. It is a hardware component that helps in the translation of virtual addresses to physical addresses. The TLB is specific to each process and does not need to be saved during a context switch. It can be cleared or flushed as the new process starts execution.

Why Translation Lookaside Buffer (TLB) does not need to be saved?

The TLB is a hardware cache that is specific to each process. It is used to speed up the translation of virtual addresses to physical addresses by caching frequently accessed page table entries. However, the contents of the TLB are not part of the process's state that needs to be saved during a context switch. Here's why:

1. TLB is not part of the process's address space: The TLB is a hardware cache managed by the CPU, and it is not part of the process's address space. It does not store any of the process's data or instructions. Instead, it caches page table entries for faster address translation.

2. TLB entries are specific to virtual addresses: The TLB stores virtual-to-physical address mappings. Since the virtual addresses used by one process may not be valid for another process, there is no need to save and restore TLB entries during a context switch.

3. TLB can be cleared or invalidated: When a context switch occurs, the TLB can be cleared or invalidated, as the new process will have its own set of virtual-to-physical address mappings. This allows the TLB to be refreshed with the new process's page table entries when it starts executing.

In summary, the Translation Lookaside Buffer (TLB) does not need to be saved on a context switch because it is a hardware cache specific to each process and does not store any critical information that needs to be preserved.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer?
Question Description
Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following need not necessarily be saved on a context switch between processes?a)General purpose registersb)Translation look aside bufferc)Program counterd)All of the aboveCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev