Saturday, January 21, 2012

Swap and its role in resource sharing


Swap is a mechanism to coordinate process to share main memory efficiently, and make processor busy. It helps to achieve high performance.

Role in resource sharing
Process normally swapped out from main memory to disk, or from disk to main memory.  Swap is a way for OS to provide more memory than is what physically available by keeping the portions of the primary memory in secondary storage. It allows more tasks to be loaded in memory at the same time. It goes well with multitasking systems, and allows another process to run when the running process need to wait for some portion of memory to be reloaded from secondary storage like disk, or extended memory.
Describe timeout interrupt and its role in resource sharing

Timeout interrupt
Timeout interrupt is signal generated by operation system to invoke any threads waiting on clock tick after particular set time interval.

Role in resource sharing
It’s one of the signal with highest priority, so current running threads are suspended and any thread which are waiting for this signal or thread which are suppose to get access to resource gets priority to access it. Its used by kernel process scheduler, for context switching.

Source: Wiki, OS books, case study

No comments:

Post a Comment