An operating system must manage limited resources. There is intense and heavy competition for these limited resources, so HOW does an operating system manage to efficiently balance resources?
OS resource management techniques
Resource management is the dynamic allocation and de-allocation by an operating system of processor cores, memory pages, and various types of bandwidth to computations that compete for those resources. The objective is to allocate resources so as to optimize responsiveness subject to the finite resources available. 
|scheduling||The aim of CPU scheduling is to make the system efficient, fast and fair. Scheduling is the method by which work is assigned to resources that complete the work.. There are many different scheduling strategies. The main purposes of scheduling algorithms are to minimize resource starvation and to ensure fairness amongst the parties utilizing the resources Different scheduling approaches are:
There is a video here which goes into some depth about scheduling. You do not need to understand this for your IB test, but this material will help you have a deeper understanding of this content.
|policies||Given a particular task, policy refers to what needs to be done (i.e. activities to perform) and mechanism refers to how to do it (i.e. implementation to enforce policy).. Put another way, the separation of mechanism and policy is a design principle in computer science. It states that mechanisms (those parts of a system implementation that control the authorization of operations and the allocation of resources) should not dictate (or overly restrict) the policies according to which decisions are made about which operations to authorize, and which resources to allocate. Please distinguish between policy and mechanism. Policies are ways to choose which activities to perform. Mechanisms are the implementations that enforce policies.
There is a video here goes into some depth about scheduling policies. You do not need to understand this for your IB test, but this material will help you have a deeper understanding of this content.
|multitasking||In computing, multitasking is a concept of performing multiple tasks (also known as processes) over a certain period of time by executing them concurrently.. Multitasking operating systems allow more than one program to run at a time. They can support either preemptive multitasking, where the OS doles out time to applications (virtually all modern OSes) or cooperative multitasking, where the OS waits for the program to give back control (Windows 3.x, Mac OS 9 and earlier).
There is a video here where you can learn more about multitasking. It's a bit dry, but the content is excellent. You do not need to understand this for your IB test, but this material will help you have a deeper understanding of this content.
|virtual memory||In computing, virtual memory (also virtual storage) is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a very large (main) memory.. This video is deliciously excellent: https://www.youtube.com/watch?time_continue=1&v=qlH4-oHnBb8
The primary benefits of virtual memory include freeing applications (and programmers) from having to manage a shared memory space, increasing security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging. Indeed, almost every virtual memory implementations divide a virtual address space into blocks of contiguous virtual memory addresses, called pages, which are usually 4 KB in size.
Prior to virtual memory we used overlays, which you can learn about by clicking here.
|paging||This is related to virtual memory. In computer operating systems, paging is a memory management scheme by which a computer stores and retrieves data from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. Paging is an important part of virtual memory implementations in modern operating systems, using secondary storage to let programs exceed the size of available physical memory.. For a deeper (and excellent) look at paging, please click here
|interrupt||In system programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities. There are two types of interrupts: hardware interrupts and software interrupts. .
Basically, the processor has a set of interrupt wires which are connected to a bunch of devices. When one of the devices has something to say, it turns its interrupt wire on, which triggers the processor (without the help of any software) to pause the execution of current instructions and start running a handler function.
An interrupt is a hardware mechanism that enables CPU to detect that a device needs its attention. The CPU has a wire interrupt-request line which is checked by CPU after execution of every single instruction. When CPU senses an interrupt signal on the interrupt-request line, CPU stops its currently executing task and respond to the interrupt send by I/O device by passing the control to interrupt handler. The interrupt handler resolves the interrupt by servicing the device.
Although CPU is not aware when an interrupt would occur as it can occur at any moment, but it has to respond to the interrupt whenever it occurs.
When the interrupt handler finishes executing the interrupt, then the CPU resumes the execution of the task that it has stopped for responding the interrupt. Software, hardware, user, some error in the program, etc. can also generate an interrupt. Interrupts handling nature of CPU leads to multitasking, i.e. a user can perform a number of different tasks at the same time.
If more than one interrupts are sent to the CPU, the interrupt handler helps in managing the interrupts that are waiting to be processed. As interrupt handler gets triggered by the reception of an interrupt, it prioritizes the interrupts waiting to be processed by the CPU and arranges them in a queue to get serviced.
There is a video which helps you understand interrupts very well. You do not need to understand this for your IB test, but this material will help you have a deeper understanding of this content. This video is also superb to help you understand interrupts.
|polling||Polling, or polled operation, in computer science, refers to actively sampling the status of an external device by a client program as a synchronous activity. .
Key Differences Between Interrupt and Polling in OS:
There is a video here which may help you better understand polling. You do not need to understand this for your IB test, but this material will help you have a deeper understanding of this content.
- Outline OS resource management techniques: scheduling, policies, multitasking, virtual memory, paging, interrupt, polling.