April 2017
Intermediate to advanced
594 pages
25h 15m
English
The program starts creating a Phaser object that will control the synchronization of the threads at the end of each phase. The constructor of Phaser receives the number of participants as a parameter. In our case, Phaser has three participants. This number indicates Phaser the number of threads that need to execute the arriveAndAwaitAdvance() method before Phaser could change the phase and wake up the threads that have been sleeping.
Once Phaser has been created, we launch three threads that are executed using three different FileSearch objects.
Read now
Unlock full access