public static enum UtlGovernor.WaitStrategy extends Enum<UtlGovernor.WaitStrategy>
UtlGovernor
in
#bEnum Constant and Description |
---|
BusySpin
With this strategy
blockToNext will
spin waiting for the next time. |
Sleep
With this strategy
blockToNext will sleep
until the calculated time at which the next operation should be performed. |
Yield
With this strategy
blockToNext will
call Thread.yield() in a loop until it is time to perform the
next operation. |
Modifier and Type | Method and Description |
---|---|
static UtlGovernor.WaitStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UtlGovernor.WaitStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final UtlGovernor.WaitStrategy BusySpin
blockToNext
will
spin waiting for the next time. This strategy is optimal for performance
as it avoids context switching.public static final UtlGovernor.WaitStrategy Yield
blockToNext
will
call Thread.yield()
in a loop until it is time to perform the
next operation. This strategy is good for cases where there may not be
an adequate number of cpus or governors are being used across a pool
of Threads sharing a few cores.public static final UtlGovernor.WaitStrategy Sleep
blockToNext
will sleep
until the calculated time at which the next operation should be performed.
This strategy is good for conserving CPU especially in cases where the
target rate is low enough that sleep provides good enough resolution
to achieve the target rate of operations and BusySpin or Yielding policies
would be overkill.public static UtlGovernor.WaitStrategy[] values()
for (UtlGovernor.WaitStrategy c : UtlGovernor.WaitStrategy.values()) System.out.println(c);
public static UtlGovernor.WaitStrategy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2019 Neeve Research, LLC. All Rights Reserved.