Q1. Explain how operating system acts as a Resource Manager?
Ans. Modern computers consist of processors, memories, timers, disks, mice, network interfaces, printers, and a wide variety of other devices. In the alternative view, the job of the operating system is to provide for an orderly and controlled allocation of the processors, memories, and input/output devices among the various programs competing for them.
When a computer (or network) has multiple users, the need for managing and protecting the memory, input/output devices, and other resources is even greater, since the users might otherwise interface with one another. In addition, users often need to share not only hardware, but information (files, databases, etc.) as well. In short, this view of the operating system holds that its primary task is to keep track of which programs are using which resources, to grant resource requests, to account for usage, and to mediate conflicting requests from different programs and users.
Resource management includes multiplexing (sharing) resources in two different ways:
- Time Multiplexing
- Space Multiplexing
1. Time Multiplexing
When the resource is time multiplexed, different programs or users take turns using it. First one of them gets to use the resource, then another, and so on.
With only one CPU and multiple programs that want to run on it, operating system first allocates the CPU to one long enough, another one gets to use the CPU, then another and ten eventually the first one again.
Determining how the resource is time multiplexed – who goes next and for how long – is the task of the operating system.
2. Space Multiplexing
In space multiplexing, instead of the customers taking turns, each one gets part of the resource.
Main memory is normally divided up among several running programs, so each one can be resident at the same time (for example, in order to take turns using the CPU). Assuming there is enough memory to hold multiple programs, it is more efficient to hold several programs in memory at once rather than give one of them all of it, especially if it only needs a small fraction of the total. Of course, this raises issues of fairness, protection, and so on, and it is up to the operating system to solve them.