remm        2005/06/24 06:14:29

  Modified:    util/java/org/apache/tomcat/util/net AprEndpoint.java
  Log:
  - Better default maxThreads (20 is likely a bit too low).
  - Use wait/notify when "running out" of threads rather than sleep, as it does
    not mean the same as for the regular connector.
  
  Revision  Changes    Path
  1.50      +5 -7      
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
  
  Index: AprEndpoint.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- AprEndpoint.java  24 Jun 2005 10:25:25 -0000      1.49
  +++ AprEndpoint.java  24 Jun 2005 13:14:28 -0000      1.50
  @@ -156,7 +156,7 @@
       /**
        * Maximum amount of worker threads.
        */
  -    protected int maxThreads = 20;
  +    protected int maxThreads = 60;
       public void setMaxThreads(int maxThreads) { this.maxThreads = 
maxThreads; }
       public int getMaxThreads() { return maxThreads; }
   
  @@ -663,12 +663,9 @@
           Worker workerThread = createWorkerThread();
           while (workerThread == null) {
               try {
  -                // Wait a little for load to go down: as a result,
  -                // no accept will be made until the concurrency is
  -                // lower than the specified maxThreads, and current
  -                // connections will wait for a little bit instead of
  -                // failing right away.
  -                Thread.sleep(100);
  +                synchronized (workers) {
  +                    workers.wait();
  +                }
               } catch (InterruptedException e) {
                   // Ignore
               }
  @@ -687,6 +684,7 @@
           synchronized (workers) {
               workers.push(workerThread);
               curThreadsBusy--;
  +            workers.notify();
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to