Futures, Scheduling, and Work Distribution
How to write Parallel Apps?
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Matrix Multiplication
Thread Overhead
Thread Pools
Thread Pool = Abstraction
ExecutorService Interface
Future<T>
Future<T>
Future<T>
Future<?>
Future<?>
Future<?>
Note
Matrix Addition
Matrix Addition
Matrix Addition Task
Matrix Addition Task
Matrix Addition Task
Matrix Addition Task
Matrix Addition Task
Dependencies
Fibonacci
Disclaimer
Multithreaded Fibonacci
Multithreaded Fibonacci
Multithreaded Fibonacci
Dynamic Behavior
Fibonacci DAG
Fibonacci DAG
Fibonacci DAG
Fibonacci DAG
Fibonacci DAG
How Parallel is That?
Unfolded DAG
Parallelism?
Work?
Critical Path?
Critical Path?
Notation Watch
Simple Laws
Performance Measures
Sequential Composition
Parallel Composition
Matrix Addition
Matrix Addition
Addition
Addition
Addition
Addition
Addition
Matrix Multiplication Redux
Matrix Multiplication Redux
First Phase …
Second Phase …
Multiplication
Multiplication
Multiplication
Multiplication
Parallelism
Shared-Memory Multiprocessors
Ideal Scheduling Hierarchy
Realistic Scheduling Hierarchy
For Example
Speedup
Scheduling Hierarchy
Greedy Scheduling
Greedy Scheduling
Theorem
Theorem
Theorem
Theorem
TP ≤ T1/P + T∞
Near-Optimality
Proof of Near-Optimality
Work Distribution
Work Dealing
The Problem with Work Dealing
Work Stealing
Lock-Free Work Stealing
Local Work Pools
Work DEQueue1
Obtain Work
New Work
Whatcha Gonna do When the Well Runs Dry?
Steal Work from Others
Steal this Task!
Task DEQueue
Task DEQueue
Ideal
Compromise
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Dreaded ABA Problem
Fix for Dreaded ABA
Bounded DEQueue
Bounded DEQueue
Bounded DEQueue
Bounded DEQueue
pushBottom()
pushBottom()
pushBottom()
Steal Work
Steal Work
Steal Work
Steal Work
Steal Work
Steal Work
Take Work
Take Work
Take Work
Take Work
Take Work
Take Work
Take Work
Take Work
Take Work
Take Work
Old English Proverb
Variations
Work Balancing
Work-Balancing Thread
Work-Balancing Thread
Work-Balancing Thread
Work-Balancing Thread
Work-Balancing Thread
Work-Balancing Thread
Work Stealing & Balancing