tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r936289 - in /tomcat/trunk: java/org/apache/catalina/core/StandardThreadExecutor.java webapps/docs/changelog.xml webapps/docs/config/executor.xml
Date Wed, 21 Apr 2010 12:55:20 GMT
Author: jfclere
Date: Wed Apr 21 12:55:19 2010
New Revision: 936289

URL: http://svn.apache.org/viewvc?rev=936289&view=rev
Log:
Fix for 43642.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/config/executor.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java?rev=936289&r1=936288&r2=936289&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardThreadExecutor.java Wed Apr 21 12:55:19
2010
@@ -74,6 +74,11 @@ public class StandardThreadExecutor exte
     protected String name;
     
     /**
+     * prestart threads?
+     */
+    protected boolean prestartminSpareThreads = false;
+
+    /**
      * The maximum number of elements that can queue up before we reject them
      */
     protected int maxQueueSize = Integer.MAX_VALUE;
@@ -101,6 +106,9 @@ public class StandardThreadExecutor exte
         taskqueue = new TaskQueue(maxQueueSize);
         TaskThreadFactory tf = new TaskThreadFactory(namePrefix,daemon,getThreadPriority());
         executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), maxIdleTime,
TimeUnit.MILLISECONDS,taskqueue, tf);
+        if (prestartminSpareThreads) {
+            executor.prestartAllCoreThreads();
+        }
         taskqueue.setParent(executor);
 
         setState(LifecycleState.STARTING);
@@ -172,6 +180,10 @@ public class StandardThreadExecutor exte
         return name;
     }
 
+    public boolean isPrestartminSpareThreads() {
+
+        return prestartminSpareThreads;
+    }
     public void setThreadPriority(int threadPriority) {
         this.threadPriority = threadPriority;
     }
@@ -205,6 +217,10 @@ public class StandardThreadExecutor exte
         }
     }
 
+    public void setPrestartminSpareThreads(boolean prestartminSpareThreads) {
+        this.prestartminSpareThreads = prestartminSpareThreads;
+    }
+
     public void setName(String name) {
         this.name = name;
     }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=936289&r1=936288&r2=936289&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Apr 21 12:55:19 2010
@@ -35,6 +35,9 @@
 <section name="Tomcat 7.0.0 (markt)">
   <subsection name="Catalina">
     <changelog>
+      <add>
+        <bug>43642</bug>: Add prestartminSpareThreads attribute for Executor.
(jfclere)
+      </add>
       <update>
         Update Servlet support to the Servlet 3.0 specification. Note
         asynchronous support is not yet complete. (markt/fhanik)

Modified: tomcat/trunk/webapps/docs/config/executor.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/executor.xml?rev=936289&r1=936288&r2=936289&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/executor.xml (original)
+++ tomcat/trunk/webapps/docs/config/executor.xml Wed Apr 21 12:55:19 2010
@@ -102,6 +102,10 @@
       <p>(int) The number of milliseconds before an idle thread shutsdown, unless the
number of active threads are less
          or equal to minSpareThreads. Default value is <code>60000</code>(1 minute)</p>
     </attribute>
+    <attribute name="prestartminSpareThreads" required="false">
+      <p>(boolean) Whether minSpareThreads should be started when starting the Executor
or not,
+          the default is <code>false</code></p>
+    </attribute>
   </attributes>
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message