f1
future = fork(f2)
f3
join(future)
f4
f1 can run in parallel with: ________________
f2 can run in parallel with: ________________
f3 can run in parallel with: ________________
f4 can run in parallel with: ________________
f1
future = fork(()-> {
f2()
return f3();
})
f4
join(future)
f5
f1 can run in parallel with: ________________
f2 can run in parallel with: ________________
f3 can run in parallel with: ________________
f4 can run in parallel with: ________________
f5 can run in parallel with: ________________
f1();
Future<Integer> futureA = fork(() -> {
f2();
Future<Integer> futureB = fork(() -> {
f3();
return f4();
});
f5();
join(futureB);
return f6();
});
f7();
join(futureA);
f8();
f1 can run in parallel with: ________________
f2 can run in parallel with: ________________
f3 can run in parallel with: ________________
f4 can run in parallel with: ________________
f5 can run in parallel with: ________________
f6 can run in parallel with: ________________
f7 can run in parallel with: ________________
f8 can run in parallel with: ________________