UNIX Programming and Technical

Q. Is the Process before and after the swap are the same? Give reason.

A. Process before swapping is residing in the primary memory in its original form. The regions (text, data and stack) may not be occupied fully by the process, there may be few empty slots in any of the regions and while swapping Kernel do not bother about the empty slots while swapping the process out.
After swapping the process resides in the swap (secondary memory) device. The regions swapped out will be present but only the occupied region slots but not the empty slots that were present before assigning.
While swapping the process once again into the main memory, the Kernel referring to the Process Memory Map, it assigns the main memory accordingly taking care of the empty slots in the regions.

Read Solution (Total 0)

UNIX Other Question

Q. What are the events done by the Kernel after a process is being swapped out from the main memory?

A. When Kernel swaps the process out of the primary memory, it performs the following:
Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory,
Kernel allocates the space for the swapping process in the swap device,
Kernel locks the other swapping process while the current swapping operation is going on,
The Kernel saves the swap address of the region in the region table
Q. What do you mean by u-area (user area) or u-block?

A. This contains the private data that is manipulated only by the Kernel. This is local to the Process, i.e. each process is allocated a u-area.