Class ThreadPool


  • public class ThreadPool
    extends java.lang.Object
    • Field Detail

      • NAME_THREADS

        private static final boolean NAME_THREADS
      • busy_pools

        static final java.util.List 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

        static final java.lang.ThreadLocal tls
      • name

        private final java.lang.String name
      • thread_name_index

        private int thread_name_index
      • execution_limit

        private long execution_limit
      • busy

        private final java.util.List busy
      • queue_when_full

        private final boolean queue_when_full
      • task_queue

        private final java.util.List<AERunnable> task_queue
      • 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

        private final Average task_average
      • log_cpu

        private boolean log_cpu
    • Constructor Detail

      • ThreadPool

        public ThreadPool​(java.lang.String _name,
                          int _max_size)
      • ThreadPool

        public ThreadPool​(java.lang.String _name,
                          int _max_size,
                          boolean _queue_when_full)
    • Method Detail

      • checkAllTimeouts

        protected static void checkAllTimeouts()
      • generateEvidence

        private void generateEvidence​(IndentWriter writer)
      • setWarnWhenFull

        public void setWarnWhenFull()
      • setLogCPU

        public void setLogCPU()
      • getMaxThreads

        public int getMaxThreads()
      • setThreadPriority

        public void setThreadPriority​(int _priority)
      • setExecutionLimit

        public void setExecutionLimit​(long millis)
      • run

        public ThreadPool.threadPoolWorker run​(AERunnable runnable,
                                               boolean high_priority,
                                               boolean manualRelease)
        Parameters:
        runnable -
        high_priority - inserts at front if tasks queueing
      • runIt

        protected void runIt​(AERunnable runnable)
      • checkWarning

        protected void checkWarning()
      • getQueuedTasks

        public AERunnable[] getQueuedTasks()
      • getOldestQueuedTask

        public AERunnable getOldestQueuedTask()
      • getQueueSize

        public int getQueueSize()
      • isQueued

        public boolean isQueued​(AERunnable task)
      • getRunningTasks

        public AERunnable[] getRunningTasks()
      • getRunningCount

        public int getRunningCount()
      • isFull

        public boolean isFull()
      • setMaxThreads

        public void setMaxThreads​(int max)
      • checkTimeouts

        protected void checkTimeouts()
      • getName

        public java.lang.String getName()