com.octo.android.robospice.priority
Class PriorityThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
com.octo.android.robospice.priority.PausableThreadPoolExecutor
com.octo.android.robospice.priority.PriorityThreadPoolExecutor
- All Implemented Interfaces:
- Executor, ExecutorService
public final class PriorityThreadPoolExecutor
- extends PausableThreadPoolExecutor
A ThreadPoolExecutor with priority management, from SOF
There are some inherent limitations to this mechanism. For instance, the
first runnable/callable passed to the executor doesn't go in the queue. Thus
the priority mechanism will only apply when tasks are queued, and this
happens when the number of current runners is exceeds the number of max
thread in the pool size.
- Author:
- SNI
Methods inherited from class java.util.concurrent.ThreadPoolExecutor |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated |
PriorityThreadPoolExecutor
public PriorityThreadPoolExecutor(int corePoolSize,
int maxPoolSize,
int threadPriority)
PriorityThreadPoolExecutor
public PriorityThreadPoolExecutor(int poolSize,
int threadPriority)
PriorityThreadPoolExecutor
public PriorityThreadPoolExecutor(int poolSize)
getPriorityExecutor
public static PriorityThreadPoolExecutor getPriorityExecutor(int nCoreThreads,
int maxPoolSize,
int threadPriority)
getPriorityExecutor
public static PriorityThreadPoolExecutor getPriorityExecutor(int nThreads,
int threadPriority)
getPriorityExecutor
public static PriorityThreadPoolExecutor getPriorityExecutor(int nThreads)
newTaskFor
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable,
T value)
- Overrides:
newTaskFor
in class AbstractExecutorService
submit
public Future<?> submit(Runnable task)
- Specified by:
submit
in interface ExecutorService
- Overrides:
submit
in class AbstractExecutorService
Copyright © 2012-2014. All Rights Reserved.