Enum SpinPolicy
- java.lang.Object
-
- java.lang.Enum<SpinPolicy>
-
- com.conversantmedia.util.concurrent.SpinPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SpinPolicy>
public enum SpinPolicy extends java.lang.Enum<SpinPolicy>
Three SpinPolicy values are supported. WAITING - An experimental queuing strategy that supports applications that use a small number of threads. In general, "WAITING" performs better than BLOCKING BLOCKING - Java style synchronization, fair and well behaved on the processor. This is very slow and undercuts some of the advantage of using the Disruptor in the first place. SPINNING - For extreme performance scenarios where processor utilization is not a concern, this will slightly lower latency over WAITING but at a cost of spin locking the CPU. Created by jcairns on 2/18/16.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SpinPolicy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SpinPolicy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SpinPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
WAITING
public static final SpinPolicy WAITING
-
BLOCKING
public static final SpinPolicy BLOCKING
-
SPINNING
public static final SpinPolicy SPINNING
-
-
Method Detail
-
values
public static SpinPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SpinPolicy c : SpinPolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SpinPolicy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-