"Hi, Amigo!"
16
Task
Java Multithreading, level 8, lesson 10
Mastering Callable
Implement the getTask method. It should return a Callable object.
The Callable object must calculate the sum of the numbers from 1 to the passed number (i), inclusive, and return it as a String.
The main method is not tested.
32
Task
Java Multithreading, level 8, lesson 10
Plants vs Zombies
1. Read about java.util.concurrent.Phaser.
2. Put the methods in the right places:
- arriveAndDeregister(): starts calling the tasks' run methods,
- arriveAndAwaitAdvance(): waits for all threads to be created.
9
Task
Java Multithreading, level 8, lesson 10
ReentrantReadWriteLock
The ReadWriteMap class must correctly provide access to a Map object across multiple threads, but mistakes
were made during implementation. Find them and fix them.
9
Task
Java Multithreading, level 8, lesson 10
FutureTask
The FactorialCalculator class is designed to calculate the factorial of a number passed to its constructor as an
argument. Unfortunately, it is not implemented correctly and you need to fix it.
Carefully analyze the Solution class's main method.