Thread
smallest unit of execution in a process;
can run independently on CPU cores.
Process
isolated program instance with its own memory space
Parallelism
Executing multiple operations simultaneously to improve throughput.
Concurrency
Structuring a program to manage multiple tasks that may overlap in time.
Synchronization
coordinating access to shared resources
Thread Pool
fixed set of threads used to execute multiple tasks;
reduces overhead of creating threads repeatedly.
Mutex
Mutual exclusion object to protect shared data;
ensures only one thread accesses critical section at a time.
Spinlock
Busy-wait lock;
low-latency for short critical sections, but wastes CPU cycles.
Semaphore
Controls access to a resource with a counter;
useful for producer-consumer patterns.
Condition Variable
Allows threads to wait for a condition;
used in combination with mutexes.
Atomic Operations
Lock-free operations on single variables
avoid mutex overhead.
Thread-local Storage
(TLS)
Data unique to each thread;
avoids sharing and contention.
Race Condition
Multiple threads accessing shared data without proper synchronization
Deadlock
Two or more threads waiting indefinitely on each other’s locks
std::async
Launches a function asynchronously (potentially on a separate thread) and returns a future representing the eventual result
std::future
A read-only placeholder for a result that will become available later.
std::promise
Sets a value or exception that a future can retrieve.
scheduling
process by which the operating system decides which threads or processes run on CPU cores and for how long
context switching
process by which the CPU saves the state of the currently running thread or process and loads the state of another to resume execution