Name: _____________________________ 6 Digit StudentID: ___ ___ ___ ___ ___ ___

Worksheet 24: arrive, awaitAdvance, and Shared Work

class Phaser

PhaserUtils

Draw The Computation Graph To The Right

s1
Phaser ph = new Phaser();
ph.register();
Future<Void> f = void_fork(()->{
    s2
    ph.arrive();
    s3
});
s4
PhaserUtils.awaitAdvanceForPhase(ph, 0);
s5
join(f);
s6

What can run in parallel with:

s1?

s2?

s3?

s4?

s5?

s6?

Iterative Averaging Shared Work

Imagine an array of length 20 below which is sliced up into 3 Ranges A, B, and C:

For Sliced Range A

 

 

For Sliced Range B

 

 

For Sliced Range C

 

 

Post Lecture

Synthesize today's class session

 

 

What is unclear?