Lesson 134
Concurrency & Parallelism
Interleaving vs Simultaneity · <br>Races · Locks · Deadlock
1:00Why concurrency and parallelism are not the same, how race conditions happen, how locks and semaphores fix them, and how Amdahl's law bounds the speedup from adding more cores.
By the end, you can
- Explain the difference between concurrency and parallelism, and give an example of each.
- Describe why threads sharing memory create race conditions, and trace the lost-update problem on an unsynchronized read-modify-write (two threads each read the same counter value, both increment, and one update is overwritten).
- Explain how a mutex provides mutual exclusion over a critical section.
- State the four Coffman conditions and identify which one a specific prevention strategy breaks.
- Distinguish deadlock from livelock and from starvation.
- Describe the roles of the two semaphores and the mutex in the producer–consumer pattern.
- Apply Amdahl's law to calculate the maximum speedup given a serial fraction and a core count.
- Explain why a single-threaded async event loop is concurrent but not parallel.
Up next in Software Engineering & Web




