diff src/main/java/christie/codegear/StartCodeGear.java @ 196:ad49723367c2

add priority
author akahori
date Sat, 09 Mar 2019 14:03:06 +0900
parents be58bfe90766
children ef5aad739292
line wrap: on
line diff
--- a/src/main/java/christie/codegear/StartCodeGear.java	Sat Mar 09 10:19:03 2019 +0900
+++ b/src/main/java/christie/codegear/StartCodeGear.java	Sat Mar 09 14:03:06 2019 +0900
@@ -7,12 +7,13 @@
 
 public abstract class StartCodeGear extends CodeGear{
     static ConcurrentHashMap<Integer, CodeGearManager> cgmList = new ConcurrentHashMap<>();
-    static LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<Runnable>();
-    static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), // initial number of threads
+    //static LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<Runnable>();
+    /*static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), // initial number of threads
             Runtime.getRuntime().availableProcessors(),
             Integer.MAX_VALUE, // keepAliveTime
             TimeUnit.SECONDS,
-            taskQueue);
+            taskQueue);*/
+    static ThreadPoolExecutor threadPoolExecutor = PriorityThreadPoolExecutors.createThreadPool(Runtime.getRuntime().availableProcessors(), Integer.MAX_VALUE);
     static int cgmCount = 1;
 
     public StartCodeGear(CodeGearManager cgm){