OS: Processes, Threads, and Concurrency
Operating systems flashcards — process vs thread, scheduling basics, and concurrency hazards.
12 cards· by GuruOwl
Make a deck like this from your own PDF — free.
Try it- 01What is a process?A program in execution with its own address space, resources, and at least one thread of control.process
- 02What is a thread?A unit of execution within a process that shares the process address space and resources with sibling threads.thread
- 03What is the key isolation difference between processes and threads?Processes are memory-isolated from each other; threads of the same process share memory (requiring synchronization).comparison
- 04What is a context switch?Saving the state of one running task and restoring another so the CPU can change which process/thread runs.scheduling
- 05What is a race condition?When outcome depends on unpredictable timing/interleaving of concurrent operations on shared state.concurrency
- 06What is a critical section?A code region that accesses shared resources and must not be executed by multiple threads concurrently.concurrency
- 07What is a mutex (mutual exclusion lock)?A synchronization primitive that allows only one thread at a time to hold the lock and enter a critical section.sync
- 08What is deadlock?A state where threads wait forever for resources held by each other (circular wait with no progress).deadlock
- 09Name the four Coffman conditions for deadlock.Mutual exclusion; hold-and-wait; no preemption; circular wait.deadlock
- 10What is a semaphore?A synchronization counter supporting wait/signal (P/V) operations — can control access by multiple units of a resource.sync
- 11User-level vs kernel-level threads (one-line tradeoff)?User threads are cheaper to switch but a blocking syscall can block the whole process; kernel threads are scheduled by the OS with higher overhead.thread
- 12What does “CPU-bound” vs “I/O-bound” mean for scheduling?CPU-bound tasks mostly compute; I/O-bound tasks often wait on I/O — schedulers mix them for responsiveness and utilization.scheduling