Author: tv
Date: Sun Jan 15 18:00:02 2017
New Revision: 1778930

URL: http://svn.apache.org/viewvc?rev=1778930&view=rev
Log:
Use number of available processors as default minimum pool size

Modified:
    
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/threadpool/ThreadPoolManager.java

Modified: 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/threadpool/ThreadPoolManager.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/threadpool/ThreadPoolManager.java?rev=1778930&r1=1778929&r2=1778930&view=diff
==============================================================================
--- 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/threadpool/ThreadPoolManager.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-core/src/main/java/org/apache/commons/jcs/utils/threadpool/ThreadPoolManager.java
 Sun Jan 15 18:00:02 2017
@@ -51,7 +51,7 @@ import org.apache.commons.logging.LogFac
  *
  * int maximumPoolSize_DEFAULT = 150;
  *
- * int minimumPoolSize_DEFAULT = 4;
+ * int minimumPoolSize_DEFAULT = number of processors as reported by the JVM;
  *
  * int keepAliveTime_DEFAULT = 1000 * 60 * 5;
  *
@@ -72,27 +72,27 @@ public class ThreadPoolManager
     private static final Log log = LogFactory.getLog( ThreadPoolManager.class 
);
 
     /**
-     * DEFAULT SETTINGS, these are not final since they can be set via the 
properties file or object
+     * DEFAULT SETTINGS
      */
-    private static boolean useBoundary_DEFAULT = true;
+    private static final boolean useBoundary_DEFAULT = true;
 
     /** Default queue size limit */
-    private static int boundarySize_DEFAULT = 2000;
+    private static final int boundarySize_DEFAULT = 2000;
 
     /** Default max size */
-    private static int maximumPoolSize_DEFAULT = 150;
+    private static final int maximumPoolSize_DEFAULT = 150;
 
     /** Default min */
-    private static int minimumPoolSize_DEFAULT = 4;
+    private static final int minimumPoolSize_DEFAULT = 
Runtime.getRuntime().availableProcessors();
 
     /** Default keep alive */
-    private static int keepAliveTime_DEFAULT = 1000 * 60 * 5;
+    private static final int keepAliveTime_DEFAULT = 1000 * 60 * 5;
 
     /** Default when blocked */
-    private static WhenBlockedPolicy whenBlockedPolicy_DEFAULT = 
WhenBlockedPolicy.RUN;
+    private static final WhenBlockedPolicy whenBlockedPolicy_DEFAULT = 
WhenBlockedPolicy.RUN;
 
     /** Default startup size */
-    private static int startUpSize_DEFAULT = 4;
+    private static final int startUpSize_DEFAULT = minimumPoolSize_DEFAULT;
 
     /** The default config, created using property defaults if present, else 
those above. */
     private static PoolConfiguration defaultConfig;


Reply via email to