Package net.sf.eBus.config
Class EConfigure.ThreadConfig
- java.lang.Object
-
- net.sf.eBus.config.EConfigure.ThreadConfig
-
- Direct Known Subclasses:
EConfigure.Dispatcher,EConfigure.ScheduledExecutor
- Enclosing class:
- EConfigure
protected abstract static class EConfigure.ThreadConfig extends Object
Base class forEConfigure.DispatcherandEConfigure.ScheduledExecutorcontaining settings common to both configurations.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringmNameThe unique thread name.protected DurationmParkTimeIfmThreadTypeisspin+park, then park for this many time limit before returning to spinning.protected intmPriorityThread run at this priority.protected longmSpinLimitIfmThreadTypeisspin+parkorspin+yield, then spin this many times on trying to acquire the next client before parking/yielding.protected ThreadTypemThreadTypeSpecifies thread operation: blocking, spinning, spin+park, or spin+yield.
-
Constructor Summary
Constructors Modifier Constructor Description protectedThreadConfig(EConfigure.ThreadBuilder<?,?> builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreadAffinityConfigure[]affinity()Returns thread affinity andnullif no affinity is set.booleanequals(Object o)inthashCode()Stringname()Returns the unique thread name.DurationparkTime()Returns the park time used byspin+parkthread type.intpriority()Returns the thread priority.longspinLimit()Returns the spin limit used byspin+parkandspin+yieldthread types.
-
-
-
Field Detail
-
mName
protected final String mName
The unique thread name. Used to create Java thread name.
-
mThreadType
protected final ThreadType mThreadType
Specifies thread operation: blocking, spinning, spin+park, or spin+yield.
-
mSpinLimit
protected final long mSpinLimit
IfmThreadTypeisspin+parkorspin+yield, then spin this many times on trying to acquire the next client before parking/yielding.
-
mParkTime
protected final Duration mParkTime
IfmThreadTypeisspin+park, then park for this many time limit before returning to spinning.
-
mPriority
protected final int mPriority
Thread run at this priority. Must be ≥Thread.MIN_PRIORITYand ≤Thread.MAX_PRIORITY.
-
-
Constructor Detail
-
ThreadConfig
protected ThreadConfig(EConfigure.ThreadBuilder<?,?> builder)
-
-
Method Detail
-
name
public final String name()
Returns the unique thread name.- Returns:
- thread name.
-
spinLimit
public final long spinLimit()
Returns the spin limit used byspin+parkandspin+yieldthread types.- Returns:
- spin limit.
-
parkTime
public final Duration parkTime()
Returns the park time used byspin+parkthread type.- Returns:
- nanosecond park time.
-
priority
public final int priority()
Returns the thread priority.- Returns:
- thread priority.
-
affinity
public ThreadAffinityConfigure[] affinity()
Returns thread affinity andnullif no affinity is set. This affinity is used to associate a thread with a particular CPU.- Returns:
- thread affinity.
-
-