public class ForkJoinThreadPool extends ForkJoinPool implements BaseThreadPool
Modifier and Type | Class and Description |
---|---|
static class |
ForkJoinThreadPool.ForkJoinThreadFactory |
static class |
ForkJoinThreadPool.ForkJoinUncaughtExceptionHandler |
ForkJoinPool.ForkJoinWorkerThreadFactory, ForkJoinPool.ManagedBlocker
defaultForkJoinWorkerThreadFactory
Constructor and Description |
---|
ForkJoinThreadPool(int numThreads,
boolean asyncMode)
Constructor for ForkJoinThreadPool.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable command)
If current thread is the main thread (i.e. not a ForkJoinWorkerThread), we have to submit the task to the pool
Else we fork a new task that will be pushed in ForkJoinWorkerThread's local deque.
|
int |
getNbThreadBlocked()
Getter for the field
nbThreadBlocked . |
String |
getStats()
getStats.
|
protected void |
reportRuntimeError(String exceptionMsg)
reportRuntimeError.
|
int |
staticGetNumThreadBlockingPoints() |
int |
staticGetNumThreadsCreated() |
void |
staticSetNumThreadBlockingPoints(int numThreadBlockingPoints) |
void |
staticSetNumThreadsCreated(int numThreadsCreated) |
void |
threadBlockedNotification(ForkJoinPool.ManagedBlocker managedBlocker)
Notification when a thread has been blocked by the HJ runtime by some synchronization constraint.
|
void |
threadUnblockedNotification()
Notification when a thread has been unblocked in the HJ runtime by some synchronization constraint.
|
awaitQuiescence, awaitTermination, commonPool, drainTasksTo, execute, getActiveThreadCount, getAsyncMode, getCommonPoolParallelism, getFactory, getParallelism, getPoolSize, getQueuedSubmissionCount, getQueuedTaskCount, getRunningThreadCount, getStealCount, getUncaughtExceptionHandler, hasQueuedSubmissions, invoke, invokeAll, isQuiescent, isShutdown, isTerminated, isTerminating, managedBlock, newTaskFor, newTaskFor, pollSubmission, shutdown, shutdownNow, submit, submit, submit, submit, toString
invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParallelism, shutdown, shutdownNow
public ForkJoinThreadPool(int numThreads, boolean asyncMode)
Constructor for ForkJoinThreadPool.
numThreads
- the parallelism level.asyncMode
- if true, establishes local first-in-first-out scheduling mode for forked tasks that are never
joined. This mode may be more appropriate than default locally stack-based mode in applications
in which worker threads only process event-style asynchronous tasks. For default value, use
false.public final String getStats()
getStats.
getStats
in interface BaseThreadPool
public final void threadBlockedNotification(ForkJoinPool.ManagedBlocker managedBlocker)
managedBlocker
- the given blockerprotected final void reportRuntimeError(String exceptionMsg)
reportRuntimeError.
exceptionMsg
- a String
object.public final void threadUnblockedNotification()
public final int getNbThreadBlocked()
Getter for the field nbThreadBlocked
.
getNbThreadBlocked
in interface BaseThreadPool
public final void execute(Runnable command)
If current thread is the main thread (i.e. not a ForkJoinWorkerThread), we have to submit the task to the pool Else we fork a new task that will be pushed in ForkJoinWorkerThread's local deque.
execute
in interface BaseThreadPool
execute
in interface Executor
execute
in class ForkJoinPool
public int staticGetNumThreadsCreated()
staticGetNumThreadsCreated
in interface BaseThreadPool
public void staticSetNumThreadsCreated(int numThreadsCreated)
staticSetNumThreadsCreated
in interface BaseThreadPool
public int staticGetNumThreadBlockingPoints()
staticGetNumThreadBlockingPoints
in interface BaseThreadPool
public void staticSetNumThreadBlockingPoints(int numThreadBlockingPoints)
staticSetNumThreadBlockingPoints
in interface BaseThreadPool
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.