
public class ForkJoinThreadPool extends ForkJoinPool implements BaseThreadPool
| Modifier and Type | Class and Description |
|---|---|
static class |
ForkJoinThreadPool.ForkJoinThreadFactory |
static class |
ForkJoinThreadPool.ForkJoinUncaughtExceptionHandler |
ForkJoinPool.ForkJoinWorkerThreadFactory, ForkJoinPool.ManagedBlockerdefaultForkJoinWorkerThreadFactory| 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, toStringinvokeAll, invokeAny, invokeAnyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParallelism, shutdown, shutdownNowpublic 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 BaseThreadPoolpublic 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 BaseThreadPoolpublic 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 BaseThreadPoolexecute in interface Executorexecute in class ForkJoinPoolpublic int staticGetNumThreadsCreated()
staticGetNumThreadsCreated in interface BaseThreadPoolpublic void staticSetNumThreadsCreated(int numThreadsCreated)
staticSetNumThreadsCreated in interface BaseThreadPoolpublic int staticGetNumThreadBlockingPoints()
staticGetNumThreadBlockingPoints in interface BaseThreadPoolpublic void staticSetNumThreadBlockingPoints(int numThreadBlockingPoints)
staticSetNumThreadBlockingPoints in interface BaseThreadPoolCopyright © 2015 Rice University - Department of Computer Science. All rights reserved.