1/37
Flashcards covering key concepts around concurrency, deadlock, memory management, virtual memory, and scheduling algorithms in operating systems.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Deadlock
Occurs when processes are permanently blocked, each holding a resource the other needs.
Coffman’s Conditions
Four necessary conditions for deadlock: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
Mutual Exclusion
Resources are non-sharable.
Hold and Wait
A process holds one resource while requesting another.
No Preemption
Resources cannot be forcibly taken from a process.
Circular Wait
A closed chain of processes, each holding a resource the next needs.
Deadlock Prevention
Ensure at least one of the four Coffman’s conditions cannot occur.
Deadlock Avoidance
Use algorithms to ensure the system stays in a safe state.
Banker’s Algorithm
An algorithm that ensures resource allocations do not lead to unsafe states.
Starvation
A process never acquires the resources it needs, even though they are available intermittently.
Aging
Increasing a process’s priority the longer it waits to prevent starvation.
Memory Management Requirements
Include relocation, protection, sharing, logical and physical organization.
Fixed Partitioning
Divide memory into fixed-size regions at startup, leading to internal fragmentation.
Dynamic Partitioning
Create partitions dynamically to fit processes, leading to external fragmentation.
Paging
Divide logical address space into equal-sized pages and physical memory into frames.
Page Table
Maps each page to a specific frame in memory.
TLB (Translation Lookaside Buffer)
A cache that speeds up page-table lookups.
Segmentation
Break a program’s memory into segments corresponding to logical program structures.
External Fragmentation
Occurs because segments can vary in size, leaving unusable free memory.
Virtual Memory
The OS presents a large, uniform address space to each process, even with limited physical memory.
Page Fault
Triggered when a page not in memory is accessed.
FIFO (First-In, First-Out)
Replace the oldest loaded page; simple but can lead to Belady’s anomaly.
LRU (Least Recently Used)
Replace the page that has not been used for the longest time.
Optimal Page Replacement
Replace the page that will not be used for the longest time in the future.
Thrashing
Excessive paging when a process does not have enough frames for its working set.
Working Set Model
Tracks the set of pages a process is currently using.
Long-Term (Job) Scheduling
Controls how many processes enter the system.
Medium-Term Scheduling
Swaps processes in and out of memory.
Short-Term (CPU) Scheduling
Chooses which process in the ready queue runs next.
FCFS (First-Come, First-Served)
Simplest scheduling algorithm, can lead to the convoy effect.
Round Robin (RR)
Uses time slices of equal length for each process, good for interactive systems.
SJF (Shortest Job First)
Minimizes average waiting time but can cause starvation for long jobs.
Priority Scheduling
Process with the highest priority runs first, risking starvation if unmanaged.
Symmetric Multiprocessing (SMP)
All CPUs share a global ready queue for scheduling tasks equally.
Hard Real-Time
Missing a deadline is catastrophic, e.g., flight control systems.
Soft Real-Time
Missing a deadline is undesirable but not catastrophic, e.g., multimedia applications.
Priority Inversion
A lower-priority task holds a resource needed by a higher-priority task.
Priority Inheritance
Temporarily boosts the priority of a lower-priority task to avoid long delays.