- Sample Sort
- Parallel Quick Sort
- Draw quick sort.
- Easy to parallelize, but first partition is sequential.
- Can avoid sequential code by sampling instead.
- Count example
- Discuss semaphores
- Second count example
Conditions for a data race:
- Concurrent execution of two processes / threads.
- Shared data that both processes access (read or write)
- At least one process writes
Barriers and data races:
- Review the barrier code.
- Figure out how it stops data races.
Conditions for a deadlock:
- Sem-queue example
- This is way less safe than just using locks. Requires careful analysis.