CS343 - Concurrent and Parallel Programming
https://student.cs.uwaterloo.ca/~cs343/
Book: file:///Users/stevengong/My%20Drive/Waterloo/4A/CS343/notes.pdf Notes: https://student.cs.uwaterloo.ca/~cs343/F25/notes.pdf
Summary / cheat sheet: Concurrency Problems
Language used throughout the course: uC++
Course outline (from the notes):
An introduction to concurrent programming, with an emphasis on language constructs. Major topics include: exceptions, coroutines, atomic operations, critical sections, mutual exclusion, semaphores, high-level concurrency, deadlock, interprocess communication, process structuring on shared memory architectures.
Concepts
Chapter 1: Advanced Control Flow (Review)
Chapter 2: Nonlocal Transfer
- Nonlocal Transfer
- Dynamic Multi-Level Exit
- Exception Handling
- Static Propagation
- Dynamic Propagation
- Termination
- Resumption
Chapter 3: Coroutine
- Coroutine
- Semi-Coroutine
- Full Coroutine
- Stackless vs Stackful Coroutine
- uC++ EHM
- _CatchResume
- Object Binding
- Bound Handler
- Nonlocal Exception
- UnhandledException
- Coroutine Examples
- Same Fringe Problem
- Device Driver
- full)
- Ping/Pong
- Coroutine Languages
- Python 3.5 async/await
- JavaScript async
- C++20 Coroutines
Chapter 4: More Exceptions
- Derived Exception-Type
- Catch-Any
- Exception Parameters
- Exception List
- Destructor Exceptions
- Multiple Exceptions
Chapter 5: Concurrency
- Concurrency
- Concurrent Hardware
- Execution States
- Threading Model (1:1, N:1, M:N)
- Amdahl’s Law
- Thread Creation
- Termination Synchronization
- Divide-and-Conquer (concurrent)
- Critical Section
- Mutual Exclusion
- Mutual Exclusion Game
- Self-Testing Critical Section
- Software Mutual-Exclusion Solutions
- Hardware Mutual-Exclusion Solutions
Chapter 6: Locks
- Lock Taxonomy
- Spin Lock
- Blocking Locks
- Synchronization Locks
- Barrier
- Binary Semaphore
- Counting Semaphore
- Lock Programming
Chapter 7: Concurrent Errors
- Race Condition
- No-Progress failures
- Live-lock
- Starvation
- Deadlock
- Synchronization Deadlock
- Mutual Exclusion Deadlock
- Deadlock Prevention
- Deadlock Avoidance
- Deadlock Detection and Recovery
Chapter 8: Indirect Communication (Monitors)
- Critical Regions
- Conditional Critical Regions
- Monitor
- Monitor Scheduling
- Nested Monitor Calls
- Intrusive Lists
- Monitor Types (Hoare, Mesa, etc)
- Java Monitor
Chapter 9: Direct Communication (Tasks)
- Task
- Task Scheduling
- Returning Values
- Increasing Concurrency
Chapter 10: Optimization
- Sequential Optimizations
- Cache Review
- Cache Coherence
- Concurrent Optimizations
- Memory Model
- Preventing Optimization Problems
Chapter 11: Other Approaches
- Atomic (Lock-Free) Data-Structure
- Safe Memory Reclamation Problem
- Exotic Atomic Instruction
- General-Purpose GPU (GPGPU)
- Concurrency Languages
- Ada 95
- SR / Concurrent C++
- Java
- Go
- C++11 Concurrency
- Threads & Locks Libraries
- java.util.concurrent
- Pthreads
- OpenMP