I am trying to understand Phaser in java. I wrote an example which is stuck at advance waiting for other parties to arrive.
As far as I understand, phaser is used as
You initialize your Phaser with a value of 1:
Phaser phaser = new Phaser(1);
This means that your main thread is one of the threads you are waiting for, but it never calls arrive().
As the number of your threads is fixed, you should initialize the Phaser with the thread number, and remove the register() calls.