public class SyncThreadPool extends AbstractThreadPool
ExecutorService
implementation, which function the similar way as
former Grizzly 1.x Pipeline based thread pools.
The SyncThreadPool is synchronized similar way as Grizzly 1.x Pipeline,
which makes thread pool more accurate when deciding to create or not
additional worker threads.Modifier and Type | Class and Description |
---|---|
protected class |
SyncThreadPool.SyncThreadWorker |
AbstractThreadPool.Worker
Modifier and Type | Field and Description |
---|---|
protected int |
maxQueuedTasks |
config, DEFAULT_IDLE_THREAD_KEEPALIVE_TIMEOUT, DEFAULT_MAX_TASKS_QUEUED, DEFAULT_MAX_THREAD_COUNT, DEFAULT_MIN_THREAD_COUNT, delayedQueue, monitoringConfig, poison, running, stateLock, transactionTimeoutMillis, workers
Constructor and Description |
---|
SyncThreadPool(ThreadPoolConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable task) |
protected void |
onWorkerExit(AbstractThreadPool.Worker worker)
Method is called by
AbstractThreadPool.Worker , when it's completing
AbstractThreadPool.Worker.run() method execution, which in most cases means,
that ThreadPool's thread will be released. |
protected void |
poisonAll() |
protected void |
startWorker(AbstractThreadPool.Worker worker)
must hold statelock while calling this method.
|
String |
toString() |
afterExecute, awaitTermination, beforeExecute, drain, getConfig, getDefaultThreadFactory, getMonitoringConfig, getQueue, isShutdown, isTerminated, onMaxNumberOfThreadsReached, onTaskCompletedEvent, onTaskDequeued, onTaskQueued, onTaskQueueOverflow, onWorkerStarted, shutdown, shutdownNow, uncaughtException, validateNewPoolSize
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public SyncThreadPool(ThreadPoolConfig config)
public void execute(Runnable task)
protected void startWorker(AbstractThreadPool.Worker worker)
AbstractThreadPool
startWorker
in class AbstractThreadPool
protected void onWorkerExit(AbstractThreadPool.Worker worker)
AbstractThreadPool
AbstractThreadPool.Worker
, when it's completing
AbstractThreadPool.Worker.run()
method execution, which in most cases means,
that ThreadPool's thread will be released. This method is called from
AbstractThreadPool.Worker
's thread.onWorkerExit
in class AbstractThreadPool
protected void poisonAll()
poisonAll
in class AbstractThreadPool
public String toString()
toString
in class AbstractThreadPool
Copyright © 2015 Oracle Corporation. All rights reserved.