Context-Switching

Question 1

Which  of  the  following  actions  is/are  typically  not  performed  by  the  operating system when switching context from process A to process B?

A
Saving current register values and restoring saved register values for process B.
B
Changing address translation tables.
C
Swapping out the memory image of process A to the disk.
D
Invalidating the translation look-aside buffer.
Question 1 Explanation: 
A) True.
B) True.
C) False, because swapping is done when the process is suspended and not during context switching.
D) True, Invalidation of TLB is necessary because, if the TLB is not invalidated then the new process might end up using the translation of old process. Note that Invalidation of TLB is necessary but saving and reuse of TLB is not necessary.
Question 2

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
Question 2 Explanation: 
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.
There are 2 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access