Quickie
Quickie
2. OS as a Resource Manager
Resource Allocation: Dynamically assigns CPU time, memory, and I/O resources to processes.
Resource Tracking: Uses data structures (like process tables) to monitor resource usage.
Protection: Isolates processes to prevent interference and unauthorized access.
Scheduling: Balances load through CPU scheduling and ensures fairness.
2. Specialized Systems
Real-Time OS vs. Distributed OS:
RTOS: Focus on meeting strict timing deadlines.
Distributed OS: Manage a network of computers as one unified system with transparency and fault tolerance.
(Reference: citeturn1file0)
2. Virtualization Types
Hardware Virtualization: Creating complete virtual machines.
OS-Level Virtualization (Containers): Isolates user-space instances (e.g., Docker, LXC) sharing the same kernel.
Application Virtualization: Encapsulates applications from the OS.
Network and Storage Virtualization: Abstracts network resources and aggregates storage into a single pool.
(Reference: citeturn1file0)
3. Scheduling Algorithms
Preemptive Scheduling:
Round Robin (RR): Fixed time slices for each process.
Shortest Remaining Time First (SRTF): Chooses the process with the least remaining burst time.
Non-Preemptive Scheduling:
First Come, First Served (FCFS): Processes run to completion once started.
Criteria for a Good Scheduler: Maximizes CPU utilization, minimizes waiting and turnaround time, ensures fairness, and reduces overhead.
Process States
Running: Actively executing on the CPU.
Ready: Loaded in memory and waiting for CPU time.
Blocked (Waiting): Suspended because it’s waiting for an external event (e.g., I/O completion).
Significance
Process Management: Helps the OS track and manage processes.
Context Switching: Stores state information to switch processes seamlessly.
Resource Allocation: Centralizes management of process resources.
(Reference: citeturn0file0)
III. Process Scheduling and Algorithms
Scheduler and Scheduling
Scheduler: A component that decides which process gets CPU time.
Scheduling: The method of ordering process execution to ensure efficient resource use.
Types of Schedulers
1. Long-Term Scheduler (Job Scheduler):
Controls which processes are admitted into the system.
Regulates the degree of multiprogramming.
2. Short-Term Scheduler (CPU Scheduler):
Selects processes from the ready queue for CPU allocation.
Makes frequent, rapid decisions.
3. Medium-Term Scheduler (Swapping Scheduler):
Manages the swapping of processes between main memory and secondary storage.
Balances memory usage by moving inactive processes.
Scheduling Algorithms
Preemptive Scheduling:
Example – Round Robin (RR): Each process gets a fixed time quantum; if unfinished, it returns to the end of the queue.
Example – Shortest Remaining Time First (SRTF): The process with the smallest remaining CPU burst is chosen.
Non-Preemptive Scheduling:
Example – First Come, First Served (FCFS): Processes are scheduled in the order they arrive and run to completion.
Detailed Examples
Round Robin:
Mechanism: Processes rotate with fixed time slices.
Advantages: Fairness, improved responsiveness.
Disadvantages: Overhead due to frequent context switches.
Priority Scheduling:
Mechanism: Each process is assigned a priority; the highest priority process is selected next.
Variants: Can be preemptive or non-preemptive.
Advantages: High-priority tasks get prompt service.
Disadvantages: Risk of starvation for lower-priority processes; possible priority inversion.
(Reference: citeturn0file0)