Midterm Topics
- Operating system goals
- Performance
- Robustness (Safety)
- Efficiency
- Functionality
- Combinations of goals: Safe sharing, Efficient protection...
- Big concepts (that come up again and again)
- Process
- Thread
- Race condition
- Critical section
- Interrupts
- Polling vs. interrupt-driven
- Mechanism vs. policy
- Bootstrapping principles: BIOS, physical memory layout
- File descriptors and structures
- A single abstraction for (almost) all resource access (Why is this important?)
- File descriptors vs. file structures
open
, read
, write
, rename
, unlink
- File descriptor manipulation:
dup2
, pipe
, close
- Flags:
O_CREAT
, O_TRUNC
, O_EXCL
(for synchronization)
- Processes
- Process vs. program
fork
, exec
, waitpid
, exit
- Creating a new process
- The process hierarchy
- Zombie processes
- Process descriptors
- When a process forks, which parts are shared, copied, or different?
- Contents: IDs, accounting, memory, registers, state, event handlers (signals), file resources, other resources
- Process state
- Running, runnable, sleeping/blocked
- Transitions between states
- Context switches
- Asynchronous event notification and signals
- The need (waking up a process that sleeps for an event, killing an uncooperative process)
- signal, kill
- Threads
- Process vs. thread
- pthread_create,
pthread_join
, pthread_exit
- Threads, stacks, and shared state (How does
pthread_create
differ from fork
and why?)
- Race conditions
- User-level threads vs. kernel threads
- Scheduling
- Goals: Fairness, Progress/Liveness, CPU utilization, Overhead...
- Parameters/Preferences, such as priority
- Metrics: Wait time, CPU utilization, Turnaround time, Throughput
- Jobs (How does a job differ from a process?)
- Gantt charts
- Cooperative vs. preemptive
- Algorithms: First Come First Serve, Shortest Job First, Round Robin, Preemptive Round Robin (with a quantum), Strict Priority, Priority with Aging, Priority with aging and CPU usage discounting
- Priority inversion
- Real-time scheduling with deadlines: Admission control vs. best-effort
- Algorithm complexity (O(n)? O(1)?)
- Synchronization
- Critical sections
- Synchronization and interrupts
- Locks
- Mutual exclusion
- Lock contention
- Spinning vs. blocking
- Priority inversion
- Coarse-grained vs. fine-grained locking
- Hardware atomic operations (e.g.,
test_and_set
, compare_and_swap
)
- Synchronization primitives: Semaphores, Producer/consumer, Monitors, Recursive mutexes, Read/write locks, Condition variables, Barriers
- Deadlock and deadlock avoidance
- The four necessary conditions: Mutual exclusion, Hold and wait, No preemption, Circular wait
- Detection and recovery
- Lock ordering
- Lock-free programming
- Event-driven programming
- Protected mode, I/O interactions, interrupts
- Programmed I/O
- Direct memory access
- Hardware operations that must be privileged