/usr/src/redhat/BUILD/httpd-2.2.3/include/ap_mpm.h

説明を見る。
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00026 #ifndef AP_MPM_H
00027 #define AP_MPM_H
00028 
00029 #include "apr_thread_proc.h"
00030 
00031 /*
00032     The MPM, "multi-processing model" provides an abstraction of the
00033     interface with the OS for distributing incoming connections to
00034     threads/process for processing.  http_main invokes the MPM, and
00035     the MPM runs until a shutdown/restart has been indicated.
00036     The MPM calls out to the apache core via the ap_process_connection
00037     function when a connection arrives.
00038 
00039     The MPM may or may not be multithreaded.  In the event that it is
00040     multithreaded, at any instant it guarantees a 1:1 mapping of threads
00041     ap_process_connection invocations.  
00042 
00043     Note: In the future it will be possible for ap_process_connection
00044     to return to the MPM prior to finishing the entire connection; and
00045     the MPM will proceed with asynchronous handling for the connection;
00046     in the future the MPM may call ap_process_connection again -- but
00047     does not guarantee it will occur on the same thread as the first call.
00048 
00049     The MPM further guarantees that no asynchronous behaviour such as
00050     longjmps and signals will interfere with the user code that is
00051     invoked through ap_process_connection.  The MPM may reserve some
00052     signals for its use (i.e. SIGUSR1), but guarantees that these signals
00053     are ignored when executing outside the MPM code itself.  (This
00054     allows broken user code that does not handle EINTR to function
00055     properly.)
00056 
00057     The suggested server restart and stop behaviour will be "graceful".
00058     However the MPM may choose to terminate processes when the user
00059     requests a non-graceful restart/stop.  When this occurs, the MPM kills
00060     all threads with extreme prejudice, and destroys the pchild pool.
00061     User cleanups registered in the pchild apr_pool_t will be invoked at
00062     this point.  (This can pose some complications, the user cleanups
00063     are asynchronous behaviour not unlike longjmp/signal... but if the
00064     admin is asking for a non-graceful shutdown, how much effort should
00065     we put into doing it in a nice way?)
00066 
00067     unix/posix notes:
00068     - The MPM does not set a SIGALRM handler, user code may use SIGALRM.
00069         But the preferred method of handling timeouts is to use the
00070         timeouts provided by the BUFF abstraction.
00071     - The proper setting for SIGPIPE is SIG_IGN, if user code changes it
00072         for any of their own processing, it must be restored to SIG_IGN
00073         prior to executing or returning to any apache code.
00074     TODO: add SIGPIPE debugging check somewhere to make sure it's SIG_IGN
00075 */
00076 
00087 AP_DECLARE(int) ap_mpm_run(apr_pool_t *pconf, apr_pool_t *plog, server_rec *server_conf);
00088 
00095 AP_DECLARE(int) ap_graceful_stop_signalled(void);
00096 
00110 AP_DECLARE(apr_status_t) ap_os_create_privileged_process(
00111     const request_rec *r,
00112     apr_proc_t *newproc, 
00113     const char *progname,
00114     const char * const *args, 
00115     const char * const *env,
00116     apr_procattr_t *attr, 
00117     apr_pool_t *p);
00118 
00119 /* Subtypes/Values for AP_MPMQ_IS_THREADED and AP_MPMQ_IS_FORKED        */
00120 #define AP_MPMQ_NOT_SUPPORTED      0  /* This value specifies whether */
00121                                       /* an MPM is capable of         */
00122                                       /* threading or forking.        */
00123 #define AP_MPMQ_STATIC             1  /* This value specifies whether */
00124                                       /* an MPM is using a static #   */
00125                                       /* threads or daemons.          */
00126 #define AP_MPMQ_DYNAMIC            2  /* This value specifies whether */
00127                                       /* an MPM is using a dynamic #  */
00128                                       /* threads or daemons.          */
00129 
00130 /* Values returned for AP_MPMQ_MPM_STATE */
00131 #define AP_MPMQ_STARTING              0
00132 #define AP_MPMQ_RUNNING               1
00133 #define AP_MPMQ_STOPPING              2
00134 
00135 #define AP_MPMQ_MAX_DAEMON_USED       1  /* Max # of daemons used so far */
00136 #define AP_MPMQ_IS_THREADED           2  /* MPM can do threading         */
00137 #define AP_MPMQ_IS_FORKED             3  /* MPM can do forking           */
00138 #define AP_MPMQ_HARD_LIMIT_DAEMONS    4  /* The compiled max # daemons   */
00139 #define AP_MPMQ_HARD_LIMIT_THREADS    5  /* The compiled max # threads   */
00140 #define AP_MPMQ_MAX_THREADS           6  /* # of threads/child by config */
00141 #define AP_MPMQ_MIN_SPARE_DAEMONS     7  /* Min # of spare daemons       */
00142 #define AP_MPMQ_MIN_SPARE_THREADS     8  /* Min # of spare threads       */
00143 #define AP_MPMQ_MAX_SPARE_DAEMONS     9  /* Max # of spare daemons       */
00144 #define AP_MPMQ_MAX_SPARE_THREADS    10  /* Max # of spare threads       */
00145 #define AP_MPMQ_MAX_REQUESTS_DAEMON  11  /* Max # of requests per daemon */
00146 #define AP_MPMQ_MAX_DAEMONS          12  /* Max # of daemons by config   */
00147 #define AP_MPMQ_MPM_STATE            13  /* starting, running, stopping  */
00148 #define AP_MPMQ_IS_ASYNC             14  /* MPM can process async connections  */
00149 
00157 AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result);
00158 
00159 /* Defining GPROF when compiling uses the moncontrol() function to
00160  * disable gprof profiling in the parent, and enable it only for
00161  * request processing in children (or in one_process mode).  It's
00162  * absolutely required to get useful gprof results under linux
00163  * because the profile itimers and such are disabled across a
00164  * fork().  It's probably useful elsewhere as well.
00165  */
00166 #ifdef GPROF
00167 extern void moncontrol(int);
00168 #define AP_MONCONTROL(x) moncontrol(x)
00169 #else
00170 #define AP_MONCONTROL(x)
00171 #endif
00172 
00173 #if AP_ENABLE_EXCEPTION_HOOK
00174 typedef struct ap_exception_info_t {
00175     int sig;
00176     pid_t pid;
00177 } ap_exception_info_t;
00178 
00179 AP_DECLARE_HOOK(int,fatal_exception,(ap_exception_info_t *ei))
00180 #endif /*AP_ENABLE_EXCEPTION_HOOK*/
00181 
00182 #endif
00183 

Apacheに対してSun Jul 19 22:05:22 2009に生成されました。  doxygen 1.4.7