Phaser Class Flashcards

1
Q

Constructor that creates a Phaser object with no registered parties and no parents. The initial phase is set to zero. Has an overloaded version that takes the number of threads that need to arrive to advance to the next stage.

A

Phaser(), Phaser(int numThreads)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Adds a new thread to this Phaser object. Returns the phase current number. Throws an IllegalStateException if the maximum supported parties are already registered.

A

int register()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Adds numThreads of unarrived parties to this phaser object. Returns the current phase number. Throws an IllegalStateException if maximum supported parties are already registerd.

A

int bulkRegister(int numThreads)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Arrives at this phase without waiting for other threads to arrive. Returns the arrival phase number. Can throw an IllegalStateException.

A

int arrive()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Same as arrive() but also deregisters from the phaser object.

A

int arriveAndDeregister()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Arrives at this phase and blocks until other threads arrive.

A

int arriveAndAwaitAdvance()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Blocks until this Phaser object advances to the given phase value.

A

int awaitAdvance(int phase)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Returns the number of threads (parties) registered with this phaser object.

A

int getRegisteredParties()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Returns the number of threads (parties) arrived at the current phase of the Phaser object.

A

int getArrivedParties()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Returns the number of threads (parties) that have not arrived when compared to the registered parties at the current phase of the Phaser object.

A

int getUnarrivedParties()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly