httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/worker worker.c
Date Wed, 01 May 2002 15:06:44 GMT
stoddard    02/05/01 08:06:44

  Modified:    server/mpm/worker worker.c
  Log:
  Defer starting the listener until we have at least tried to start all the worker
  threads.  We want to get the workers in the pool of available threads ASAP
  to keep perform_idle_server_maintenance from thrashing and starting too
  many processes prematurely.  The code before this patch would dribble workers
  into the worker pool over an extended period of time and this prevented
  perform_idle_server_maintenance from accurately deciding when new processes
  were needed.
  
  Revision  Changes    Path
  1.122     +6 -6      httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- worker.c	1 May 2002 07:15:39 -0000	1.121
  +++ worker.c	1 May 2002 15:06:44 -0000	1.122
  @@ -999,6 +999,7 @@
       apr_status_t rv;
       int i;
       int threads_created = 0;
  +    int listener_started = 0;
       int loops;
       int prev_threads_created;
   
  @@ -1061,12 +1062,11 @@
                   clean_child_exit(APEXIT_CHILDFATAL);
               }
               threads_created++;
  -            if (threads_created == 1) {
  -                /* now that we have a worker thread, it makes sense to create
  -                 * a listener thread (we don't want a listener without a worker!)
  -                 */
  -                create_listener_thread(ts);
  -            }
  +        }
  +        /* Start the listener only when there are workers available */
  +        if (!listener_started && threads_created) {
  +            create_listener_thread(ts);
  +            listener_started = 1;
           }
           if (start_thread_may_exit || threads_created == ap_threads_per_child) {
               break;
  
  
  

Mime
View raw message