google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Unix based Qs and ans

Monday, July 28, 2014

Unix based Qs and ans


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

Answer :-
1.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,
2.Kernel allocates the space for the swapping process in the swap device,
3.Kernel locks the other swapping process while the current swapping operation is going on,
4.The Kernel saves the swap address of the region in the region table.



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

Answer :-
1.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.
2.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.
3.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.




3.What is Fork swap?

Answer :-
"fork()" is a system call to create a child process. When the parent process calls "fork()" system call, the child process is created and if there is short of memory then the child process is sent to the read-to-run state in the swap device, and return to the user state without swapping the parent process. When the memory will be available the child process will be swapped into the main memory.




4.What are the entities that are swapped out of the main memory while swapping the process out of the main memory?

Answer :-
1.All memory space occupied by the process, process's u-area, and Kernel stack are swapped out, theoretically.
2.Practically, if the process's u-area contains the Address Translation Tables for the process then Kernel implementations do not swap the u-area.




5.What is Expansion swap?

Answer :-
At the time when any process requires more memory than it is currently allocated, the Kernel performs Expansion swap. To do this Kernel reserves enough space in the swap device. Then the address translation mapping is adjusted for the new virtual address space but the physical memory is not allocated. At last Kernel swaps the process into the assigned space in the swap device. Later when the Kernel swaps the process into the main memory this assigns memory according to the new address translation mapping.




No comments:

Post a Comment

अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...