No, you're not missing anything.
NIO can use a shared executor, and internal executor or the thread pool
based on synchronized/wait/notify
Filip
Mark Thomas wrote:
[EMAIL PROTECTED] wrote:
Author: fhanik
Date: Fri Nov 21 08:31:45 2008
New Revision: 719626
URL: http://svn.apache.org/viewvc?rev=719626&view=rev
Log:
Fix dynamic thread resizing
I had assumed that if an executor was used, then the executor mbean would
be used to resize the pool. Also, this is now inconsistent with the
configuration in that setting maxThreads for the connector in server.xml at
startup will not have an affect but setting it via JMX at runtime will.
This is also now inconsistent with the BIO and APT endpoints.
Am I missing something?
Mark
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=719626&r1=719625&r2=719626&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Nov 21
08:31:45 2008
@@ -354,8 +354,14 @@
public void setMaxThreads(int maxThreads) {
this.maxThreads = maxThreads;
if (running) {
- synchronized(workers) {
- workers.resize(maxThreads);
+ if (getUseExecutor() && executor!=null) {
+ if (executor instanceof ThreadPoolExecutor) {
+
((ThreadPoolExecutor)executor).setMaximumPoolSize(maxThreads);
+ }
+ }else if (workers!=null){
+ synchronized(workers) {
+ workers.resize(maxThreads);
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]