Resource Management Techniques and OS
Operating systems (OS) are responsible for managing system resources to ensure efficient and reliable operation.
It abstracts the complexity of hardware, allowing users and applications to interact with the system without needing to understand the underlying details.
NoteThe OS is like a translator, converting user commands into machine instructions and vice versa.
Example- In Windows, drive letters (e.g., C:, D:) represent storage devices.
- This abstraction allows users to interact with storage as if it were a simple directory structure, hiding the complexity of file systems and physical storage locations.
- Additionally, OS is responsible for localisation, which involves adapting software for different regions, including language, currency, and date formats.
- This can cause compatibility issues if systems are not properly configured.
- For example, some countries use different naming conventions, leading to conflicts when sharing files.
Resource management that OS does involves a range of techniques designed to optimise the use of hardware and software resources.
Scheduling
Scheduling
The process of determining which tasks or processes should be executed by the CPU at any given time.
Scheduling is crucial for maximising CPU utilisation and ensuring that all processes receive fair access to resources.
There exist different scheduling strategies, such as:
- First-Come, First-Served (FCFS):
- Processes are executed in the order they arrive.
- Use Case: Simple environments where fairness is prioritised over efficiency.
- Shortest Job First (SJF):
- Executes the process with the shortest execution time first.
- Use Case: Ideal for batch processing systems to minimise average waiting time.
- Round Robin (RR):
- Each process is given a fixed time slice (quantum) before moving to the next.
- Use Case: Multitasking syscctems where responsiveness is critical.
- Priority Scheduling:
- Processes are executed based on priority levels.
- Use Case: Real-time systems where certain tasks must be completed urgently.
The scheduler is a component of the OS that implements these algorithms, balancing factors like CPU utilisation, throughput, and response time.
Theory of KnowledgePreemptive Scheduling is when high-priority tasks can interrupt lower-priority ones, ensuring critical tasks are completed first.
Policies
Policies
The rules and guidelines for managing resources and user access within a system.
Policies define
- User Accounts and Permissions:
- Each user has a unique account with specific access rights.
- Use Case: Ensures security and prevents unauthorised access to sensitive data.
- Resource Allocation:
- Policies determine how resources like CPU time and memory are distributed among processes.
- Use Case: Prevents resource starvation and ensures fair distribution.
- Policies are distinct from mechanisms.
- While policies define what should be done, mechanisms define how it is implemented.
Multitasking
Multitasking allows multiple tasks or processes to run concurrently, giving the illusion of parallel execution via:
- Time Slicing:
- The CPU switches between tasks at regular intervals, known as time slices.
- Use Case: Ensures that all tasks receive CPU time, maintaining system responsiveness.
- Context Switching: