Home / Community / Concurrency & Parallelism in Software Engineering
Public

Concurrency & Parallelism in Software Engineering

Master core multi-threading concepts, synchronization primitives, and classic concurrency patterns with this high-yield flashcard deck designed for software engineers.

21 accessible of 21 cards

Card Preview

21 accessible of 21 cards

A quick, read-only look at the deck content.

Term

Process vs. Thread

Definition

A process is an independent, isolated execution environment with its own memory space allocated by the OS. A thread is the smallest unit of execution within a process that shares memory and resources with other threads in the same process.

Term

Concurrency vs. Parallelism

Definition

Concurrency is about dealing with multiple tasks at once by interleaving execution on a single core or multiple cores. Parallelism is about doing multiple tasks simultaneously on physical multi-core hardware.

Term

Race Condition

Definition

A flaw that occurs when a system's output depends on the non-deterministic sequence or timing of uncontrollable execution events (such as thread scheduling), leading to unpredictable behavior.

Term

Critical Section

Definition

A code segment that accesses shared resources (like global variables or files) and must not be executed by more than one thread concurrently to prevent race conditions.

Term

Mutex (Mutual Exclusion Lock)

Definition

A synchronization mechanism that grants exclusive access to a shared resource to a single thread at a time. Threads must lock the mutex before entering a critical section and unlock it upon exit.

Term

Counting Semaphore vs. Binary Semaphore

Definition

A Binary Semaphore has a state of 0 or 1 and works similarly to a mutex. A Counting Semaphore maintains an integer counter to control access to a finite pool of shared resources.

Term

Deadlock

Definition

A situation where a set of threads are blocked permanently because each thread holds a resource that another thread requires, forming a circular dependency.

Term

Four Coffman Conditions for Deadlock

Definition

1. Mutual Exclusion: Resources cannot be shared.
2. Hold and Wait: Threads hold resources while waiting for others.
3. No Preemption: Resources cannot be forcibly taken from threads.
4. Circular Wait: A closed chain of threads exists where each waits for a resource held by the next.