University Computing Flashcards: Operating Systems
Computing — Operating Systems Flashcards
20 interactive flashcards for university-level Operating Systems. Press Space to flip, rate 1-4.
Additional Flashcard Topics
Process Scheduling: FCFS, SJF, Round Robin, Priority, MLFQ. Scheduling algorithms balance throughput, response time, and fairness. Preemptive vs non-preemptive scheduling affects system responsiveness.
Memory Management: paging, segmentation, virtual memory. Pages are fixed-size blocks; segments are variable-size. Page tables map virtual to physical addresses; TLB caches recent translations.
Synchronisation Primitives: mutex, semaphore, monitor, condition variable. Mutex provides mutual exclusion; semaphore counts available resources; monitor encapsulates shared data with methods.
Deadlock: four conditions (mutual exclusion, hold-and-wait, no preemption, circular wait). Prevention breaks one condition; avoidance uses Banker’s algorithm; detection and recovery allows deadlocks but cleans them up.
File Systems: inodes, directory structures, journaling. Inodes store metadata (permissions, timestamps, block pointers). Journaling prevents corruption after crashes by logging changes before applying them.
I/O Management: DMA, interrupts, device drivers. DMA transfers data between devices and memory without CPU involvement. Interrupts signal completion; device drivers abstract hardware differences.
Intuition
An operating system is the layer between hardware and applications — it manages resources (CPU, memory, I/O) and provides abstractions (processes, files, sockets) that make programming manageable.
Process management intuition: A process is a running program with its own address space. The OS rapidly switches between processes (context switching) to give the illusion of simultaneous execution. Scheduling algorithms decide which process gets the CPU next — the goal is to maximise throughput, minimise response time, and ensure fairness.
Memory management intuition: Virtual memory gives each process the illusion of a private, contiguous address space. The OS translates virtual addresses to physical addresses using page tables. When physical memory is full, the OS swaps out pages to disk — this is why programs can use more memory than physically available, but with a performance penalty.
Synchronisation intuition: When multiple processes access shared data concurrently, race conditions can corrupt data. Semaphores, mutexes, and monitors provide mutual exclusion — ensuring that only one process accesses critical sections at a time. Deadlock occurs when two processes wait forever for each other’s resources.
Key Concepts
| Concept | Why It Matters |
|---|---|
| Process scheduling | Determines which process runs when; affects throughput and responsiveness |
| Virtual memory | Provides process isolation and enables programs larger than physical memory |
| Page replacement | LRU, FIFO, Optimal algorithms decide which pages to evict when memory is full |
| Deadlock prevention | Break any of the four necessary conditions to prevent deadlock entirely |
| File system | Organises storage hierarchically; journals ensure consistency after crashes |
Common Pitfalls
Confusing processes and threads. Processes have separate address spaces; threads share memory. A process crash doesn’t affect other processes, but a thread crash can corrupt shared data and bring down the entire process.
Assuming virtual memory is free. Virtual memory allows using more memory than physically available, but paging to disk is 100,000x slower than accessing RAM. Excessive paging (thrashing) can make a system unusable.
Ignoring deadlock conditions. Deadlock requires all four conditions simultaneously. Breaking even one (e.g., allowing preemption, or imposing a resource ordering) is sufficient to prevent it. Many systems use timeout-based deadlock avoidance rather than prevention.
Confusing thrashing with normal paging. Thrashing occurs when the system spends more time paging than executing useful work. It happens when the total working set exceeds physical memory. The cure is more memory or a better page replacement algorithm.
Forgetting that context switches are expensive. A context switch involves saving and restoring CPU state, flushing TLBs, and potentially swapping cache contents. Frequent context switches degrade performance significantly.
Cross-References
- Operating Systems Practice: Process management, synchronisation, and memory management.
- Systems: Computer architecture and hardware systems; OS implements the abstractions.
- Databases: Transaction management and concurrency control; databases depend on OS primitives.
- Algorithms: Scheduling and page replacement algorithms use algorithm design techniques.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.
Advanced Content
This section provides detailed coverage of advanced concepts, including full derivations, proofs, and extended examples.
Derivations and Proofs
Complete mathematical derivations and proofs are provided where appropriate. Each step is explained to ensure understanding of the underlying reasoning.
Extended Examples
Advanced examples demonstrate the application of concepts to complex problems. These examples go beyond standard exam questions to develop deeper understanding.
Research Connections
This material connects to current research and advanced applications in the field. Understanding these connections provides context for the study material.
Prerequisites
Ensure you have mastered the prerequisite material before attempting this advanced content.