Class ThreadPoolVirtual<T extends AERunnable>
java.lang.Object
com.biglybt.core.util.ThreadPoolVirtual<T>
- All Implemented Interfaces:
ThreadPoolParent<T>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ThreadPoolVirtual<T>.threadPoolWorker> private static booleanprivate static final List<ThreadPoolVirtual<?>> private intprivate static booleanprivate static booleanprivate longprivate booleanprivate static final booleanprivate final Stringprivate static final booleanprivate final booleanprivate intprivate final Averageprivate longprivate longprivate intprivate intprivate final AESemaphore(package private) static final ThreadLocalprivate static final intprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionThreadPoolVirtual(String _name, int _max_size) ThreadPoolVirtual(String _name, int _max_size, boolean _queue_when_full) -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidprotected voidprotected voidvoidprivate voidgenerateEvidence(IndentWriter writer) intgetName()intintbooleanisFull()booleanisQueued(AERunnable task) void(package private) voidreleaseManual(ThreadPoolTask toRelease) voidvoidprotected voidrunIt(AERunnable runnable) voidvoidvoidsetExecutionLimit(long millis) voidvoidsetMaxThreads(int max) voidsetThreadPriority(int _priority) void
-
Field Details
-
NAME_THREADS
private static final boolean NAME_THREADS -
LOG_WARNINGS
private static final boolean LOG_WARNINGS- See Also:
-
WARN_TIME
private static final int WARN_TIME- See Also:
-
busy_pools
-
busy_pool_timer_set
private static boolean busy_pool_timer_set -
debug_thread_pool
private static boolean debug_thread_pool -
debug_thread_pool_log_on
private static boolean debug_thread_pool_log_on -
tls
-
name
-
thread_name_index
private int thread_name_index -
execution_limit
private long execution_limit -
busy
-
queue_when_full
private final boolean queue_when_full -
task_queue
-
thread_sem
-
target_permits
private int target_permits -
current_permits
private int current_permits -
thread_priority
private int thread_priority -
warn_when_full
private boolean warn_when_full -
task_total
private long task_total -
task_total_last
private long task_total_last -
task_average
-
log_cpu
private boolean log_cpu
-
-
Constructor Details
-
ThreadPoolVirtual
-
ThreadPoolVirtual
-
-
Method Details
-
checkAllTimeouts
protected static void checkAllTimeouts() -
generateEvidence
-
setWarnWhenFull
public void setWarnWhenFull()- Specified by:
setWarnWhenFullin interfaceThreadPoolParent<T extends AERunnable>
-
setLogCPU
public void setLogCPU() -
getMaxThreads
public int getMaxThreads()- Specified by:
getMaxThreadsin interfaceThreadPoolParent<T extends AERunnable>
-
setThreadPriority
public void setThreadPriority(int _priority) -
setExecutionLimit
public void setExecutionLimit(long millis) -
runTask
- Specified by:
runTaskin interfaceThreadPoolParent<T extends AERunnable>
-
runTask
- Specified by:
runTaskin interfaceThreadPoolParent<T extends AERunnable>
-
run
-
run
- Parameters:
runnable-high_priority- inserts at front if tasks queueing
-
runIt
-
checkWarning
protected void checkWarning() -
getQueuedTasks
-
getOldestQueuedTask
-
getQueueSize
public int getQueueSize() -
isQueued
- Specified by:
isQueuedin interfaceThreadPoolParent<T extends AERunnable>
-
getRunningTasks
- Specified by:
getRunningTasksin interfaceThreadPoolParent<T extends AERunnable>
-
getRunningCount
public int getRunningCount()- Specified by:
getRunningCountin interfaceThreadPoolParent<T extends AERunnable>
-
isFull
public boolean isFull()- Specified by:
isFullin interfaceThreadPoolParent<T extends AERunnable>
-
setMaxThreads
public void setMaxThreads(int max) - Specified by:
setMaxThreadsin interfaceThreadPoolParent<T extends AERunnable>
-
checkTimeouts
protected void checkTimeouts() -
getName
- Specified by:
getNamein interfaceThreadPoolParent<T extends AERunnable>
-
releaseManual
-
registerThreadAsChild
- Specified by:
registerThreadAsChildin interfaceThreadPoolParent<T extends AERunnable>
-
deregisterThreadAsChild
- Specified by:
deregisterThreadAsChildin interfaceThreadPoolParent<T extends AERunnable>
-