Package co.paralleluniverse.fibers
Class FiberForkJoinScheduler
- java.lang.Object
-
- co.paralleluniverse.fibers.FiberScheduler
-
- co.paralleluniverse.fibers.FiberForkJoinScheduler
-
- All Implemented Interfaces:
FiberFactory,StrandFactory
public class FiberForkJoinScheduler extends FiberScheduler
AForkJoinPoolbased scheduler for fibers.
-
-
Constructor Summary
Constructors Constructor Description FiberForkJoinScheduler(java.lang.String name, int parallelism)Creates a new fiber scheduler using a defaultUncaughtExceptionHandlerand no monitoring.FiberForkJoinScheduler(java.lang.String name, int parallelism, co.paralleluniverse.common.monitoring.MonitorType monitorType, boolean detailedInfo)Creates a new fiber scheduler using a defaultUncaughtExceptionHandler.FiberForkJoinScheduler(java.lang.String name, int parallelism, java.lang.Thread.UncaughtExceptionHandler exceptionHandler, co.paralleluniverse.common.monitoring.MonitorType monitorType, boolean detailedInfo)Creates a new fiber scheduler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.ExecutorgetExecutor()java.util.concurrent.ForkJoinPoolgetForkJoinPool()protected intgetQueueLength()protected booleanisCurrentThreadInScheduler()static booleanisFiberThread(java.lang.Thread t)protected voidonIdle()voidshutdown()-
Methods inherited from class co.paralleluniverse.fibers.FiberScheduler
getMonitor, getName, newFiber, newStrand
-
-
-
-
Constructor Detail
-
FiberForkJoinScheduler
public FiberForkJoinScheduler(java.lang.String name, int parallelism, java.lang.Thread.UncaughtExceptionHandler exceptionHandler, co.paralleluniverse.common.monitoring.MonitorType monitorType, boolean detailedInfo)Creates a new fiber scheduler.- Parameters:
name- the scheuler's name. This name is used in naming the scheduler's threads.parallelism- the number of threads in the poolexceptionHandler- anUncaughtExceptionHandlerto be used for exceptions thrown in fibers that aren't caught.monitorType- theMonitorTypetype to use for theForkJoinPool.detailedInfo- whether detailed information about the fibers is collected by the fibers monitor.
-
FiberForkJoinScheduler
public FiberForkJoinScheduler(java.lang.String name, int parallelism, co.paralleluniverse.common.monitoring.MonitorType monitorType, boolean detailedInfo)Creates a new fiber scheduler using a defaultUncaughtExceptionHandler.- Parameters:
name- the scheuler's name. This name is used in naming the scheduler's threads.parallelism- the number of threads in the poolmonitorType- theMonitorTypetype to use for theForkJoinPool.detailedInfo- whether detailed information about the fibers is collected by the fibers monitor.
-
FiberForkJoinScheduler
public FiberForkJoinScheduler(java.lang.String name, int parallelism)Creates a new fiber scheduler using a defaultUncaughtExceptionHandlerand no monitoring.- Parameters:
name- the scheuler's name. This name is used in naming the scheduler's threads.parallelism- the number of threads in the pool
-
-
Method Detail
-
shutdown
public void shutdown()
- Overrides:
shutdownin classFiberScheduler
-
getForkJoinPool
public java.util.concurrent.ForkJoinPool getForkJoinPool()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
- Specified by:
getExecutorin classFiberScheduler
-
getQueueLength
protected int getQueueLength()
- Specified by:
getQueueLengthin classFiberScheduler
-
isCurrentThreadInScheduler
protected final boolean isCurrentThreadInScheduler()
- Specified by:
isCurrentThreadInSchedulerin classFiberScheduler
-
isFiberThread
public static boolean isFiberThread(java.lang.Thread t)
-
onIdle
protected void onIdle()
-
-