Machine-translated by Google. Questions are authored in English.
Top

Discussion

Swapping in an operating system means

  • A.moving a whole process between main memory and the backing store
  • B.exchanging the values of two variables
  • C.alternating between two CPUs
  • D.converting a file from one format to another

Answer: C

Correct answer: moving a whole process between main memory and the backing store

Swapping moves an entire process out of main memory to a backing store and later brings it back. It was the classic technique for running more processes than memory could hold, in systems that predate paging. The cost is dominated by transfer time, which is proportional to the size of the process, so swapping a large process takes a long time. That is why it was replaced by paging, which moves individual pages rather than whole processes and so pays only for what is actually needed. It also requires that the process be idle: a process with pending input or output cannot be swapped out safely, since the device would write into memory now belonging to something else. Modern systems retain a limited form of it. When memory pressure is severe, a whole process may still be suspended and its pages written out - and the term swap space survives to name the disk area used, even though what is actually written there is pages rather than whole processes.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.