Share to you (asharetoyou) with motto an easy way to share with you is a site About Design, Hardware, Operating System,

Swap

Written By Share to you on Saturday, September 24, 2011 | 3:06 PM




A process that as already explained above, must be in memory before being executed. The process of swapping is:    swap a process out of memory for a while into a temporary storage with the other processes that are in need of a number of allocations memory for execution. A temporary storage area is usually in the form of a fast disk with a capacity that can accommodate all of the copies of all memory images and provides direct access to the picture. If the execution process issued earlier will be continued after a moment, then he will be brought back to the memory of the place temporary storage before. How does the system know which processes are to be executed? This can be done with a ready queue. Ready queue contains all the processes that lie well in temporary storage or memory ready for execution. When the CPU scheduler will executing a process, If the process is not in memory then the process of swapping will be performed as described above.

Picture. Swapping Process

An example to illustrate this swapping technique is as follows: Algorithm Round- Robin used in multiprogramming environments using a time quantum (unit CPU time) in the execution of its processes. When the time quantum expires, memory manager will issue a (swap out) finished the process that has undergone at the time kuantumnya a time and insert (swap in) into the memory of other processes that have been free to them. on the same time, the CPU scheduler will allocate time to other processes in memory. This concern is, the time quantum should be long enough so that the time of use CPU can be optimized when compared with the exchange that occurs between memory and disk. Swapping technique roll out, roll in which the priority-based algorithm when the process with higher priority arrives then the memory manager will issue a priority process Lower and load the process with higher priority is. When the process with higher priority is executed then the process has been completed which has a lower priority can be put back into memory and re-executed. Most of the time swapping is the time of transfer. As an example we see the following illustration: a user process has a size of 5 MB, while the temporary storage area a harddisk(hard drive) has a data transfer speed of 20 MB per second. Then the time required to transfer the process for 5 MB of or into the memory is equal 5000 KB / 20 000 KBps = 250 ms The above calculation does not include latency time, so if we assume the latency time for 2 ms then the swap is equal to 252 ms.


Therefore there are two instances where one is the process of spending a process and another is the process of entry into the memory process, then the total time of the swap to be 252 + 252 = 504 ms. In order for swapping techniques can be more efficient, better processes in the swap is just the process that is really needed so as to reduce the time the swap. Therefore, system must always be aware of any changes that occur in meeting the needs of memory. This is where a process requires a system call function, namely to tell the system operation when he was asked when freeing memory and the memory space. If we want to do the swap, there are some things to watch. We must avoid exchange process with M / K is delayed (the operating assumption M / K is also being lined up in the queue for equipment M / Knya is busy). Examples such as this, if the process P1dikeluarkan from memory and we want to enter a process P2, then the operation of M / K which is also in the queue will take the freed memory space quota is P1. This problem can be overcome if we do not swap with the operation of M / K is postponed. In addition, the execution of the operation M / K should be performed on the operating system buffer.

 Each operating system has a version of each on swapping technique it uses. As example on UNIX, basically swapping is not enabled, but will start if many processes which requires a lot of memory allocation. Swapping will be disabled again if the number process that included reduced. In Microsoft Windows 3.1 operating system, if a process newly inserted and turned out there was not enough space in memory to contain it, a process that first is in memory will be transferred to disk. The operating system is basically not apply swapping technique in full, this is due to the user larger role in determining the process which will be exchanged instead of the CPU scheduler. With provisions like these processes has been issued will not return again to the memory until the user selects a process to executed.

No comments:

Post a Comment

Share to you with motto an easy way to share with you is a site About Design, Hardware, Operating System,