tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r528744 - in /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java
Date Sat, 14 Apr 2007 02:48:46 GMT
Author: fhanik
Date: Fri Apr 13 19:48:45 2007
New Revision: 528744

URL: http://svn.apache.org/viewvc?view=rev&rev=528744
Log:
Minor optimizations

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=528744&r1=528743&r2=528744
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Apr 13 19:48:45
2007
@@ -1326,7 +1326,7 @@
         
         public void addEvent(Runnable event) {
             events.offer(event);
-            if ( wakeupCounter.incrementAndGet() < 3 ) selector.wakeup();
+            if ( wakeupCounter.incrementAndGet() == 1 || wakeupCounter.get() > 5 ) selector.wakeup();
         }
 
         /**
@@ -1428,7 +1428,10 @@
                     int keyCount = 0;
                     try {
                         if ( !close ) {
-                            keyCount = selector.select(selectorTimeout);
+                            if ( wakeupCounter.get() > 0 )
+                                keyCount = selector.selectNow(); //we have events that need
to be processed
+                            else
+                                keyCount = selector.select(selectorTimeout);
                             wakeupCounter.set(0);
                         }
                         if (close) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java?view=diff&rev=528744&r1=528743&r2=528744
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Fri Apr 13
19:48:45 2007
@@ -82,7 +82,7 @@
      * The application write buffer size in bytes
      * Default value is txBufSize
      */
-    protected int appWriteBufSize = 8192;
+    protected int appWriteBufSize = txBufSize;
 
     /**
      * NioChannel pool size for the endpoint,



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


Mime
View raw message