University CS Flashcards: Systems
Computer Science — Systems Flashcards
20 interactive flashcards for university-level Computer Systems. Press Space to flip, rate 1-4.
Additional Flashcard Topics
- CPU Architecture: fetch-decode-execute cycle, pipelining, branch prediction. Modern CPUs use out-of-order execution and speculation to maximise instruction throughput.
- Cache Memory: L1 (fastest, smallest), L2, L3 (slowest, largest). Cache lines transfer data between CPU and main memory. Cache hits are fast; cache misses are expensive.
- Virtual Memory: page tables map virtual to physical addresses. TLB (Translation Lookaside Buffer) caches recent translations. Page faults trigger OS intervention to load data from disk.
- I/O Systems: DMA (Direct Memory Access) transfers data between devices and memory without CPU involvement. Interrupts signal the CPU when I/O completes.
- Network Protocols: TCP (reliable, ordered) vs UDP (fast, unreliable). The TCP/IP stack: link layer, network layer, transport layer, application layer.
Intuition
Computer systems are about how hardware and software cooperate to execute programs efficiently. The key abstractions — processes, virtual memory, file systems — hide complexity while creating performance trade-offs.
The memory hierarchy intuition: Fast memory is expensive and small; slow memory is cheap and large. Caches exploit temporal locality (recently accessed data will be accessed again) and spatial locality (nearby data will be accessed next). Understanding this hierarchy explains why a well-optimised program can be 100x faster than a naive one on the same hardware.
Process vs thread intuition: A process has its own address space (isolation); threads within a process share memory. Processes are safer (one crash doesn’t affect others) but more expensive to create and communicate between. Threads are lighter but require careful synchronisation to avoid race conditions.
Virtual memory intuition: Every process thinks it has the entire address space to itself. The OS translates virtual addresses to physical addresses using page tables. This gives each process isolation, allows memory overcommitment, and enables demand paging — loading pages only when accessed.
Key Concepts
| Concept | Why It Matters |
|---|---|
| Cache hierarchy | L1/L2/L3 caches bridge the CPU-memory speed gap using locality principles |
| Virtual memory | Isolates processes, enables memory overcommitment, simplifies programming |
| Context switching | OS saves/restores process state to multiplex the CPU across processes |
| Deadlock | Four conditions (mutual exclusion, hold-and-wait, no preemption, circular wait) can freeze a system |
| CAP theorem | Distributed systems can guarantee at most 2 of: Consistency, Availability, Partition tolerance |
Common Pitfalls
Confusing virtual and physical addresses. Programs see virtual addresses; the MMU translates them. A virtual address may not have a physical page mapped yet (page fault) or may be shared between processes.
Assuming caches are transparent. While caches are transparent to correctness, they have enormous performance implications. Ignoring cache locality can make an algorithm 10-100x slower on real hardware.
Ignoring the cost of synchronisation. Locks, semaphores, and monitors ensure correctness but add overhead. Over-synchronisation can serialise what should be parallel work, negating the benefit of multi-threading.
Confusing little-endian and big-endian byte ordering. Little-endian stores the least significant byte first; big-endian stores the most significant byte first. Network protocols in standard practice use big-endian; x86 processors use little-endian. Mixing them without conversion corrupts data.
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: Process management, memory, and synchronisation covered in systems; OS implements the abstractions.
- Databases: Transaction management and concurrency control in systems context; databases depend on OS for I/O and memory.
- Theory of Computation: Computability limits affect what systems can and cannot do automatically.
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.
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.