public interface HjPhaser
Phasers enable integration of producer-consumer with barrier synchronization. An activity has the option of registering with a phaser in signal-only mode or wait-only mode for producer-consumer synchronization, in addition to signal-wait mode for barrier synchronization.
At any point in time, an activity can be registered in one of four modes with respect to a phaser: signal-wait-next, signal-wait, signal-only, or wait-only. The mode defines the capabilities of the activity with respect to the phaser.
Details: Phasers: a Unified Deadlock-Free Construct for Collective and Point-to-point Synchronization. Jun Shirako, David Peixotto, Vivek Sarkar, William Scherer. Proceedings of the 2008 ACM International Conference on Supercomputing (ICS), June 2008.
Modifier and Type | Method and Description |
---|---|
void |
doNext()
The next operation has the effect of advancing each phaser on which the task is registered to its next phase,
thereby synchronizing all activities registered on the same phase.
|
void |
doWait()
Blocks until all phasers that this activity is registered with have called continue (or next since next implies
continue on all registered phasers).
|
default void |
drop()
An activity calls this method to tell the phaser that it is no longer interested in interacting with the phaser.
|
void |
drop(boolean activityEndSignal)
An activity calls this method to tell the phaser that it is no longer interested in interacting with the phaser.
|
HjPhaserMode |
getPhaserMode()
Returns the registration mode of the phaser was created with.
|
int |
getSigPhase()
Returns the signal phase number of this phaser in the currently executing task.
|
int |
getWaitPhase()
Returns the wait phase number of this phaser in the currently executing task.
|
HjPhaserPair |
inMode(HjPhaserMode phaserMode)
Return a
HjPhaserPair with the phaser in the specified registration mode. |
void |
signal()
An activity calls this method to tell the phaser that is done with whatever it intended to do during this phase
of the phaser.
|
HjPhaserPair inMode(HjPhaserMode phaserMode)
HjPhaserPair
with the phaser in the specified registration mode.phaserMode
- The phaser registration mode.HjPhaserMode getPhaserMode()
void signal()
void doWait() throws SuspendableException
This method is used internally by the Runtime and should not be visible for clients. Clients should use Runtime.doNext().
SuspendableException
void doNext() throws SuspendableException
next is equivalent to a signal followed by wait.
SuspendableException
void drop(boolean activityEndSignal)
activityEndSignal
- true if drop() was called from deregister() in activityEnd eventdefault void drop()
Default method for drop(boolean activityEndSignal)
int getSigPhase()
int getWaitPhase()
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.