public enum PauserMode extends Enum<PauserMode> implements Supplier<Pauser>
Pauser is not an enum, and implementations are not Marshallable, this makes Pausers more yaml friendly
The various Pauser modes and their properties can be seen here: Pauser Mode features
| Enum Constant and Description |
|---|
balanced
Returns a Supplier providing pausers that will busy wait (spin-wait at 100% CPU) for short
periods and then backs off when idle for longer periods.
|
busy
Returns a Supplier providing pausers this will busy wait (spin-wait at 100% CPU)
if there are sufficient available processors.
|
milli
Returns a Supplier providing pausers that sleeps for one millisecond with no back off.
|
sleepy
Returns a Supplier providing back off pausers that are less aggressive than
balanced. |
timedBusy
Returns a Supplier similar to
busy but that provides pausers that supports
TimingPauser. |
yielding
Returns a Supplier providing pausers that yields execution (see
Thread.yield(), if there are sufficient
available processors. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isolcpus()
Returns if provided Pausers requires CPU isolation.
|
boolean |
monitor()
Returns if provided Pausers can be monitored.
|
static PauserMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PauserMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PauserMode balanced
sleepy depending on the system property "pauser.minProcessors".
Runtime.availableProcessors()public static final PauserMode busy
balanced or even sleepy depending on the system property "pauser.minProcessors".
See Pauser.busy()
Runtime.availableProcessors()public static final PauserMode milli
Milli pausers have long latency times but require minimum CPU resources.
public static final PauserMode sleepy
balanced.
Sleepy pausers have relatively high latency but require limited CPU resources.
See Pauser.sleepy()
public static final PauserMode timedBusy
busy but that provides pausers that supports
TimingPauser.
public static final PauserMode yielding
Thread.yield(), if there are sufficient
available processors. Otherwise, returns a Supplier consistent with
balanced or even sleepy depending on the system property "pauser.minProcessors".
public static PauserMode[] values()
for (PauserMode c : PauserMode.values()) System.out.println(c);
public static PauserMode 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 nullpublic boolean isolcpus()
public boolean monitor()
Copyright © 2022. All rights reserved.