]> granicus.if.org Git - apache/commitdiff
Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
authorPaul J. Reder <rederpj@apache.org>
Wed, 18 Jul 2001 20:29:00 +0000 (20:29 +0000)
committerPaul J. Reder <rederpj@apache.org>
Wed, 18 Jul 2001 20:29:00 +0000 (20:29 +0000)
added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
daemon index actually used in the scoreboard. I also
updated the pertinent calls.

Paul J. Reder

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89604 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
CHANGES
include/ap_mpm.h
modules/generators/mod_info.c
server/mpm/beos/beos.c
server/mpm/experimental/perchild/perchild.c
server/mpm/perchild/perchild.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c
server/mpm/threaded/threaded.c
server/mpm/winnt/mpm_winnt.c
server/mpm_common.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index f2fe09c35a79ec02531323ad00a24cbf6d792030..2e6397ceca11a585edce1635344de49be8994001 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Changes with Apache 2.0.21-dev
 
+  *) Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
+     added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
+     daemon index actually used in the scoreboard. I also
+     updated the pertinent calls. [Paul J. Reder]
+
   *) Win32: Prevent listening sockets from being inherited by
      the Apache child process, CGI scripts, rotatelog process
      etc.  If the Apache child process segfaults, any processes 
index a957f7b947cef02c1f8e57c63aedc46b36dfcdaf..b1645b631d43bba684d2e7c50b3e269f41da3c39 100644 (file)
@@ -158,17 +158,18 @@ AP_DECLARE(apr_status_t) ap_os_create_privileged_process(
                                       /* an MPM is using a dynamic #  */
                                       /* threads or daemons.          */
 
-#define AP_MPMQ_MAX_DAEMONS           1  /* Max # of daemons             */
+#define AP_MPMQ_MAX_DAEMON_USED       1  /* Max # of daemons used so far */
 #define AP_MPMQ_IS_THREADED           2  /* MPM can do threading         */
 #define AP_MPMQ_IS_FORKED             3  /* MPM can do forking           */
 #define AP_MPMQ_HARD_LIMIT_DAEMONS    4  /* The compiled max # deamons   */
 #define AP_MPMQ_HARD_LIMIT_THREADS    5  /* The compiled max # threads   */
-#define AP_MPMQ_MAX_THREADS           6  /* Max # of threads             */
+#define AP_MPMQ_MAX_THREADS           6  /* # of threads/child by config */
 #define AP_MPMQ_MIN_SPARE_DEAMONS     7  /* Min # of spare daemons       */
 #define AP_MPMQ_MIN_SPARE_THREADS     8  /* Min # of spare threads       */
 #define AP_MPMQ_MAX_SPARE_DAEMONS     9  /* Max # of spare daemons       */
 #define AP_MPMQ_MAX_SPARE_THREADS    10  /* Max # of spare threads       */
 #define AP_MPMQ_MAX_REQUESTS_DEAMON  11  /* Max # of requests per daemon */
+#define AP_MPMQ_MAX_DAEMONS          12  /* Max # of daemons by config   */
 
 
 /**
index 4194f4b411e24eac33cac1995d94ce569fe8ebd5..04ac10ad16eba6d744999f58c3294bb91422369e 100644 (file)
@@ -415,7 +415,7 @@ static int display_info(request_rec *r)
                         "<tt>connection: %d &nbsp;&nbsp; "
                         "keep-alive: %d</tt><br>",
                         serv->timeout, serv->keep_alive_timeout);
-            ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons);
+            ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
             ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded);
             ap_mpm_query(AP_MPMQ_IS_FORKED, &forked);
             ap_rprintf(r, "MPM used is %s<br>\n", ap_show_mpm());
index 733473cf583fb43702a80a9d7f516b523d1fd310..e1df4bc1f2a9cf49e2705c64e9ec62084716794f 100644 (file)
@@ -653,7 +653,7 @@ static void server_main_loop(int remaining_threads_to_start)
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = ap_max_child_assigned;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -686,6 +686,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = ap_max_requests_per_child;
             return APR_SUCCESS;
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = ap_thread_limit;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 }
index c33cf6e6a995cc7e96b89c487153586238dfa783..188bace271cab3cf8ba3f8feddfe6fcea1c35824 100644 (file)
@@ -222,7 +222,7 @@ static apr_lock_t *thread_accept_mutex;
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = ap_max_daemons_limit;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -255,6 +255,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = max_requests_per_child;
             return APR_SUCCESS; 
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = num_daemons;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 }
index c33cf6e6a995cc7e96b89c487153586238dfa783..188bace271cab3cf8ba3f8feddfe6fcea1c35824 100644 (file)
@@ -222,7 +222,7 @@ static apr_lock_t *thread_accept_mutex;
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = ap_max_daemons_limit;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -255,6 +255,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = max_requests_per_child;
             return APR_SUCCESS; 
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = num_daemons;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 }
index 3a9102d3df4e9eebd4400fe51df773dc9ee33286..d006ab8e10262ce1cb20b8a18ac10a3878c3ba35 100644 (file)
@@ -315,7 +315,7 @@ static void accept_mutex_off(void)
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = ap_daemons_limit;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -348,6 +348,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = ap_max_requests_per_child;
             return APR_SUCCESS;
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = ap_daemons_limit;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 }
index ce43d2a80e4996fe1a705e6cfa89bbd836198bb6..365f86abefe64e4549e5e3c79d33c4236c6e6abd 100644 (file)
@@ -878,7 +878,7 @@ static void perform_idle_server_maintenance(void)
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = max_daemons_limit;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -911,6 +911,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = ap_max_requests_per_child;
             return APR_SUCCESS; 
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = ap_daemons_limit;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 } 
index f601c0d6cdb66d4470995db4d796911defe9e7c3..0f9a7b3fcba433244caa41ab7517fdb7a3e4c5f0 100644 (file)
@@ -192,7 +192,7 @@ static const char *lock_fname;
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = ap_max_daemons_limit;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -225,6 +225,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = ap_max_requests_per_child;
             return APR_SUCCESS;
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = ap_daemons_limit;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 }
index 901b5ba2060bf43062c1acdf7762806c44df4925..af024575d616881ea2527347ace632f71f80cec3 100644 (file)
@@ -1563,7 +1563,7 @@ apr_array_header_t *mpm_new_argv;
 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
 {
     switch(query_code){
-        case AP_MPMQ_MAX_DAEMONS:
+        case AP_MPMQ_MAX_DAEMON_USED:
             *result = MAXIMUM_WAIT_OBJECTS;
             return APR_SUCCESS;
         case AP_MPMQ_IS_THREADED:
@@ -1596,6 +1596,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_REQUESTS_DEAMON:
             *result = ap_max_requests_per_child;
             return APR_SUCCESS;
+        case AP_MPMQ_MAX_DAEMONS:
+            *result = 0;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 } 
index 006d813341d959361a8b21b6d41dc70b1c9a9b93..c79eeb52a166891bd53ccefafdf7289d6a460321 100644 (file)
@@ -97,7 +97,7 @@ void ap_reclaim_child_processes(int terminate)
     int not_dead_yet;
     int max_daemons;
 
-    ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons);
+    ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
     MPM_SYNC_CHILD_TABLE();
 
     for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
index 1d4216fec74cb14414de16c6858343408f8bb23b..32d5fcf0db189ff87b207b58a6aa6f6baaa0afed 100644 (file)
@@ -255,7 +255,7 @@ AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid)
     int i;
     int max_daemons_limit;
 
-    ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit);
+    ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons_limit);
 
     for (i = 0; i < max_daemons_limit; ++i)
        if (ap_scoreboard_image->parent[i].pid == pid->pid)