tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: svn commit: r719626 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Date Sat, 22 Nov 2008 19:51:49 GMT
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:
> fhanik@apache.org 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: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>     
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>   


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


Mime
View raw message