#define SERVER_IDLE_KILL 10 /* 进程正在清除空闲子进程. */
#define SERVER_NUM_STATUS 11 /* 进程的多个状态都被设置 */
进程总是从状态SERVER_STARTING开始,最后在SERVER_DEAD状态结束。当一个进程的状态处于SERVER_DEAD的时候,意味着记分板中的该插槽可以被重新利用。
6.1.1 .2.1创建记分板
记分板的所有的操作都是从创建开始的,通常只有在刚启动Apache或者平稳启动之后才需要创建。Apache中通过ap_create_scoreboard函数实现记分板的创建,该函数在scoreboard.c中实现,函数原型如下:
int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type);
参数p指定创建记分板中所需要的内存来自的内存池,而sb_type则是创建的记分板的类型,或者为SB_SHARED,或者为SB_NOT_SHARED。前者允许记分板在不同的进程之间共享,而后者则不允许。
int running_gen = 0;
int i;
if (ap_scoreboard_image) {
running_gen = ap_scoreboard_image->global->running_generation;
ap_scoreboard_image->global->restart_time = apr_time_now();
memset(ap_scoreboard_image->parent, 0, sizeof(process_score) * server_limit);
for (i = 0; i < server_limit; i ) {
memset(ap_scoreboard_image->servers[i], 0, sizeof(worker_score) * thread_limit);
}
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




