edited by
27,445 views
75 votes
75 votes

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

  1. Saving current register values and restoring saved register values for process $B$.
  2. Changing address translation tables.
  3. Swapping out the memory image of process $A$ to the disk.
  4. Invalidating the translation look-aside buffer.
edited by

3 Answers

Best answer
114 votes
114 votes

Processes are generally swapped out from memory to Disk (secondary memory) when they are suspended. So. Processes are not swapped during context switching.

TLB : Whenever any page table entry is referred for the first time it is temporarily saved in TLB. Every element of this memory has a tag. And whenever anything is searched it is compared against TLB and we can get that entry/data with less memory access.

And Invalidation of TLB means resetting TLB which is necessary because a TLB entry may belong to any page table of any process thus resetting ensures that the entry corresponds to the process that we are searching for.

Hence, option (C) is correct.

edited by
39 votes
39 votes
option C) because swapping out of the memory image of a process to disk is not done on every context switch as it would cause a huge over head but can solve problems like trashing.
11 votes
11 votes

A. When a current process is pre empted its activation record is saved and the data of next process is restored by the OS.

B. Every process have its own page table.

C. Swapping means taking data of a process that we don't need as of now from a higher level memory to lower level memory. It is only done to make space for a new process. If there are space available in main memory there is no need to do swapping. So it is only done by the OS only when it has to.

D. TLB holds records to page table of current process, when a new process comes it must be updated because the entries in TLB may be pointing to some other page table.

So C is the answer.

Answer:

Related questions

36 votes
36 votes
3 answers
1
Kathleen asked Sep 23, 2014
12,637 views
A multi-user, multi-processing operating system cannot be implemented on hardware that does not supportAddress translationDMA for disk transferAt least two modes of CPU e...
21 votes
21 votes
6 answers
3