💻 Computer Science · Operating Systems

OS tricks that make processes click

Processes, memory, and scheduling — demystified.

🖥️ OS

Memory tricks

Proven mnemonics — fast to learn, hard to forget.

🎥 How Flashcards Work
A quick walkthrough of tap-to-flip, rating, and how card colors track what you're struggling with.
← Back Next →
Operating Systems deck1 of 12
Tap to flip
← →
How well do YOU think you know this?
Easy Medium Hard Harder
Tap to flip back
Operating Systems deck
Easy0
Medium0
Hard0
Harder0
Process Life Cycle
Process states: New Ready Running Waiting Terminated
Process Life Cycle
Five states a process moves through during execution
New: being created. Ready: waiting for CPU. Running: executing. Waiting: blocked (e.g., waiting for disk). Terminated: finished. Scheduler moves processes between Ready and Running.
New
Being created
Ready
Waiting for CPU
Running
Executing on CPU
Waiting
Blocked on I/O
Terminated
Finished
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Process Life Cycle
Process states — the five?
Tap to flip
🃏 Answer
Process states: New Ready Running Waiting Terminated
NewBeing created
ReadyWaiting for CPU
RunningExecuting on CPU
WaitingBlocked on I/O
TerminatedFinished
Tap to flip back
Deadlock Conditions
Deadlock requires all 4: Mutual exclusion, Hold-and-wait, No preemption, Circular wait
Deadlock Conditions
Four conditions that must ALL be present for a deadlock
Remove any one condition → prevent deadlock. Mutual exclusion: only one process uses resource at a time. Hold and wait: holds resource while waiting for another. No preemption: can't forcibly take resources. Circular wait: chain of processes each waiting on the next.
M
Mutual exclusion
H
Hold and wait
N
No preemption
C
Circular wait
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Deadlock Conditions
Deadlock — the four required conditions?
Tap to flip
🃏 Answer
Deadlock requires all 4: Mutual exclusion, Hold-and-wait, No preemption, Circular wait
MMutual exclusion
HHold and wait
NNo preemption
CCircular wait
Tap to flip back
Virtual Memory
Virtual memory: OS swaps pages to disk — programs see more RAM than exists
Virtual Memory
The OS gives programs the illusion of abundant memory
OS uses disk as overflow when RAM fills up. Programs see a large contiguous address space. Page fault: needed page not in RAM → load from disk (slow). Paging: fixed-size blocks.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Virtual Memory
Virtual memory — how does it work?
Tap to flip
🃏 Answer
Virtual memory: OS swaps pages to disk — programs see more RAM than exists
Virtual Memory — OS uses disk as overflow when RAM fills up. Programs see a large contiguous address space. Page fault: needed page not in RAM → load from disk (slow). Paging: fixed-size blocks.
Tap to flip back
Scheduling Algorithms
CPU Scheduling: FCFS (First Come First Served), SJF (Shortest Job First), Round Robin (fixed time quantum), Priority (highest priority runs first)
Scheduling Algorithms
How the OS decides which process gets CPU time
FCFS: first come first serve — simple, long jobs block short ones. SJF: shortest job first — minimizes wait, needs job-length prediction. Round Robin: each gets a fixed time slice — fair. Priority: highest priority runs first.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Scheduling Algorithms
CPU scheduling — the main algorithms?
Tap to flip
🃏 Answer
CPU Scheduling: FCFS (First Come First Served), SJF (Shortest Job First), Round Robin (fixed time quantum), Priority (highest priority runs first)
Scheduling Algorithms — FCFS: first come first serve — simple, long jobs block short ones. SJF: shortest job first — minimizes wait, needs job-length prediction. Round Robin: each gets a fixed time slice — fair. Priority: highest priority runs first.
Tap to flip back
Thrashing
Thrashing: too many processes → constant page swapping → CPU spends all time on I/O, none on work
Thrashing
When virtual memory page swapping overwhelms the CPU
Occurs when the total working set of all processes exceeds available RAM. OS spends more time swapping pages than running processes. Solution: reduce multiprogramming degree or add RAM.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Thrashing
Thrashing — what causes it?
Tap to flip
🃏 Answer
Thrashing: too many processes → constant page swapping → CPU spends all time on I/O, none on work
Thrashing — Occurs when the total working set of all processes exceeds available RAM. OS spends more time swapping pages than running processes. Solution: reduce multiprogramming degree or add RAM.
Tap to flip back
File Systems
File systems: FAT32 (File Allocation Table 32-bit, simple and compatible), NTFS (New Technology File System, Windows journaling), ext4 (Linux), APFS (Apple File System) (Apple)
File Systems
How operating systems organize and store data on disk
File system: organizes data on storage devices. FAT32: simple, max 4GB file size, universal compatibility. NTFS: Windows, journaling (recovers from crashes), large files, permissions. ext4: Linux standard, journaling, large file support. Hierarchical structure: root → directories → files. Inodes: metadata about files (not content).
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 File Systems
File systems — FAT32, NTFS, ext4 and APFS?
Tap to flip
🃏 Answer
File systems: FAT32 (File Allocation Table 32-bit, simple and compatible), NTFS (New Technology File System, Windows journaling), ext4 (Linux), APFS (Apple File System) (Apple)
File Systems — File system: organizes data on storage devices. FAT32: simple, max 4GB file size, universal compatibility. NTFS: Windows, journaling (recovers from crashes), large files, permissions. ext4: Linux standard, journaling, large file support. Hierarchical structure: root → directories → files. Inodes: metadata about files (not content).
Tap to flip back
Memory Hierarchy
Memory hierarchy: registers → cache (L1/L2/L3) → RAM → SSD → HDD. Faster = smaller and more expensive.
Memory Hierarchy
The pyramid of memory — speed vs capacity vs cost
Registers: fastest, inside CPU, tiny (bytes). L1 cache: ~32KB per core, ~1ns. L2 cache: ~256KB, ~4ns. L3 cache: shared, ~8MB, ~40ns. RAM: ~16GB typical, ~100ns. SSD: ~1TB, ~100μs. HDD: ~4TB, ~10ms. OS and hardware move data up the hierarchy (caching) to match speed with usage patterns.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Memory Hierarchy
The memory hierarchy — fastest to slowest?
Tap to flip
🃏 Answer
Memory hierarchy: registers → cache (L1/L2/L3) → RAM → SSD → HDD. Faster = smaller and more expensive.
Memory Hierarchy — Registers: fastest, inside CPU, tiny (bytes). L1 cache: ~32KB per core, ~1ns. L2 cache: ~256KB, ~4ns. L3 cache: shared, ~8MB, ~40ns. RAM: ~16GB typical, ~100ns. SSD: ~1TB, ~100μs. HDD: ~4TB, ~10ms. OS and hardware move data up the hierarchy (caching) to match speed with usage patterns.
Tap to flip back
Context Switching
Context switch: OS saves current process state, loads another process state — enables multitasking
Context Switching
How the OS rapidly switches between processes to simulate multitasking
When CPU switches from one process to another: save current process's registers, program counter, and state to PCB (Process Control Block). Load next process's saved state. Context switches are expensive (~microseconds) — too many degrade performance. Threads have lighter context switches than processes.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Context Switching
Context switch — what happens?
Tap to flip
🃏 Answer
Context switch: OS saves current process state, loads another process state — enables multitasking
Context Switching — When CPU switches from one process to another: save current process's registers, program counter, and state to PCB (Process Control Block). Load next process's saved state. Context switches are expensive (~microseconds) — too many degrade performance. Threads have lighter context switches than processes.
Tap to flip back
Semaphores and Synchronization
Semaphore: integer variable for synchronization. Mutex (Mutual Exclusion lock, binary semaphore). P() = wait. V() = signal.
Semaphores and Synchronization
How processes coordinate access to shared resources
Semaphore: integer variable — P() decrements (wait if 0), V() increments (signal). Binary semaphore (mutex): 0 or 1, implements mutual exclusion. Counting semaphore: tracks available resources. Dining philosophers problem: classic deadlock scenario. Monitor: higher-level synchronization construct.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Semaphores and Synchronization
Semaphore vs mutex — and P() and V()?
Tap to flip
🃏 Answer
Semaphore: integer variable for synchronization. Mutex (Mutual Exclusion lock, binary semaphore). P() = wait. V() = signal.
Semaphores and Synchronization — Semaphore: integer variable — P() decrements (wait if 0), V() increments (signal). Binary semaphore (mutex): 0 or 1, implements mutual exclusion. Counting semaphore: tracks available resources. Dining philosophers problem: classic deadlock scenario. Monitor: higher-level synchronization construct.
Tap to flip back
Paging
Paging: divide memory into fixed-size pages. Page table maps virtual to physical addresses.
Paging
How virtual memory is divided into manageable chunks
Page: fixed-size block of virtual memory (typically 4KB). Frame: corresponding physical memory block. Page table: maps virtual page numbers to physical frame numbers. Page fault: accessing page not in RAM → OS loads from disk → slow. Working set: set of pages process needs — keep in RAM to minimize page faults.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Paging
Paging — how does it work?
Tap to flip
🃏 Answer
Paging: divide memory into fixed-size pages. Page table maps virtual to physical addresses.
Paging — Page: fixed-size block of virtual memory (typically 4KB). Frame: corresponding physical memory block. Page table: maps virtual page numbers to physical frame numbers. Page fault: accessing page not in RAM → OS loads from disk → slow. Working set: set of pages process needs — keep in RAM to minimize page faults.
Tap to flip back
I/O Management
I/O (Input/Output) management: buffering (temporary storage), spooling (queue for slow devices), interrupts (device signals CPU)
I/O Management
How the OS handles input and output efficiently
Busy waiting (polling): CPU repeatedly checks if I/O is done — wastes CPU cycles. Interrupts: device signals CPU when I/O complete — CPU does other work meanwhile. DMA (Direct Memory Access): device transfers data directly to memory without CPU involvement. Buffering: temporary storage to handle speed mismatch.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 I/O Management
I/O management — buffering, spooling, interrupts?
Tap to flip
🃏 Answer
I/O (Input/Output) management: buffering (temporary storage), spooling (queue for slow devices), interrupts (device signals CPU)
I/O Management — Busy waiting (polling): CPU repeatedly checks if I/O is done — wastes CPU cycles. Interrupts: device signals CPU when I/O complete — CPU does other work meanwhile. DMA (Direct Memory Access): device transfers data directly to memory without CPU involvement. Buffering: temporary storage to handle speed mismatch.
Tap to flip back
Shell and Scripting
Shell: command-line interface to OS. Script: sequence of commands in a file. Pipe: output of one command as input to next.
Shell and Scripting
The command-line interface and automation
Shell: program that interprets commands — bash, zsh, PowerShell. Pipe (|): chain commands, output of one → input of next. cat file | grep 'error' | wc -l. Redirection: > (output to file), < (input from file), >> (append). Shell scripts: automate repetitive tasks. Environment variables: KEY=value, PATH determines where programs are found.
📖 Full Lesson →
🎥 Watch Instead
▶
Video coming soon
This lesson's animated video hasn't been made yet — check back soon.
Flashcard
🃏 Shell and Scripting
Shell, script, pipe — what is each?
Tap to flip
🃏 Answer
Shell: command-line interface to OS. Script: sequence of commands in a file. Pipe: output of one command as input to next.
Shell and Scripting — Shell: program that interprets commands — bash, zsh, PowerShell. Pipe (|): chain commands, output of one → input of next. cat file | grep 'error' | wc -l. Redirection: > (output to file), < (input from file), >> (append). Shell scripts: automate repetitive tasks. Environment variables: KEY=value, PATH determines where programs are found.
Tap to flip back
🎓 Common Exam Questions

No saved cards yet — click ☆ Save on any memory trick.

Live group chat — up to 8 students per room