scoreboard.c revision 8a26dbe1da65d61ed277404f4e4d382bb53f3712
6ae232055d4d8a97267517c5e50074c2c819941and/* ====================================================================
6ae232055d4d8a97267517c5e50074c2c819941and * The Apache Software License, Version 1.1
6ae232055d4d8a97267517c5e50074c2c819941and * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
6ae232055d4d8a97267517c5e50074c2c819941and * reserved.
6ae232055d4d8a97267517c5e50074c2c819941and * Redistribution and use in source and binary forms, with or without
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc * modification, are permitted provided that the following conditions
6ae232055d4d8a97267517c5e50074c2c819941and * are met:
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 1. Redistributions of source code must retain the above copyright
2e545ce2450a9953665f701bb05350f0d3f26275nd * notice, this list of conditions and the following disclaimer.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 2. Redistributions in binary form must reproduce the above copyright
6ae232055d4d8a97267517c5e50074c2c819941and * notice, this list of conditions and the following disclaimer in
6ae232055d4d8a97267517c5e50074c2c819941and * the documentation and/or other materials provided with the
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen * distribution.
6ae232055d4d8a97267517c5e50074c2c819941and * 3. The end-user documentation included with the redistribution,
6ae232055d4d8a97267517c5e50074c2c819941and * if any, must include the following acknowledgment:
6ae232055d4d8a97267517c5e50074c2c819941and * "This product includes software developed by the
b43f840409794ed298e8634f6284741f193b6c4ftakashi * Apache Software Foundation (http://www.apache.org/)."
6ae232055d4d8a97267517c5e50074c2c819941and * Alternately, this acknowledgment may appear in the software itself,
b43f840409794ed298e8634f6284741f193b6c4ftakashi * if and wherever such third-party acknowledgments normally appear.
6ae232055d4d8a97267517c5e50074c2c819941and * 4. The names "Apache" and "Apache Software Foundation" must
4b3a8afbfcea8b265d179a122bf40dfedd1ce280takashi * not be used to endorse or promote products derived from this
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung * software without prior written permission. For written
6ae232055d4d8a97267517c5e50074c2c819941and * permission, please contact apache@apache.org.
b43f840409794ed298e8634f6284741f193b6c4ftakashi * 5. Products derived from this software may not be called "Apache",
b43f840409794ed298e8634f6284741f193b6c4ftakashi * nor may "Apache" appear in their name, without prior written
b43f840409794ed298e8634f6284741f193b6c4ftakashi * permission of the Apache Software Foundation.
6ae232055d4d8a97267517c5e50074c2c819941and * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
6ae232055d4d8a97267517c5e50074c2c819941and * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
6ae232055d4d8a97267517c5e50074c2c819941and * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
6ae232055d4d8a97267517c5e50074c2c819941and * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
6ae232055d4d8a97267517c5e50074c2c819941and * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6ae232055d4d8a97267517c5e50074c2c819941and * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6ae232055d4d8a97267517c5e50074c2c819941and * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6ae232055d4d8a97267517c5e50074c2c819941and * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
6ae232055d4d8a97267517c5e50074c2c819941and * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
6ae232055d4d8a97267517c5e50074c2c819941and * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
6ae232055d4d8a97267517c5e50074c2c819941and * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6ae232055d4d8a97267517c5e50074c2c819941and * SUCH DAMAGE.
6ae232055d4d8a97267517c5e50074c2c819941and * ====================================================================
6ae232055d4d8a97267517c5e50074c2c819941and * This software consists of voluntary contributions made by many
6ae232055d4d8a97267517c5e50074c2c819941and * individuals on behalf of the Apache Software Foundation. For more
6ae232055d4d8a97267517c5e50074c2c819941and * information on the Apache Software Foundation, please see
6ae232055d4d8a97267517c5e50074c2c819941and * Portions of this software are based upon public domain software
6ae232055d4d8a97267517c5e50074c2c819941and * originally written at the National Center for Supercomputing Applications,
6ae232055d4d8a97267517c5e50074c2c819941and * University of Illinois, Urbana-Champaign.
6ae232055d4d8a97267517c5e50074c2c819941and * This function should be renamed to cleanup_shared
6ae232055d4d8a97267517c5e50074c2c819941and * and it should handle cleaning up a scoreboard shared
6ae232055d4d8a97267517c5e50074c2c819941and * between processes using any form of IPC (file, shared memory
6ae232055d4d8a97267517c5e50074c2c819941and * segment, etc.). Leave it as is now because it is being used
6ae232055d4d8a97267517c5e50074c2c819941and * by various MPMs.
4b3a8afbfcea8b265d179a122bf40dfedd1ce280takashi ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit);
727872d18412fc021f03969b8641810d8896820bhumbedooh scoreboard_size += sizeof(process_score) * server_limit;
0d0ba3a410038e179b695446bb149cce6264e0abnd scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
0d0ba3a410038e179b695446bb149cce6264e0abnd calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
0d0ba3a410038e179b695446bb149cce6264e0abnd ap_scoreboard_image->global = (global_score *)more_storage;
0d0ba3a410038e179b695446bb149cce6264e0abnd ap_scoreboard_image->parent = (process_score *)more_storage;
205f749042ed530040a4f0080dbcb47ceae8a374rjung (worker_score **)((char*)ap_scoreboard_image + sizeof(scoreboard));
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen for (i = 0; i < server_limit; i++) {
0d0ba3a410038e179b695446bb149cce6264e0abnd ap_scoreboard_image->servers[i] = (worker_score *)more_storage;
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd ap_assert(more_storage == (char*)shared_score + scoreboard_size);
return rv;
if (ap_scoreboard_fname) {
return rv;
return APR_SUCCESS;
if (!detached) {
return APR_SUCCESS;
if (ap_scoreboard_fname) {
return rv;
return APR_SUCCESS;
return APR_SUCCESS;
return APR_SUCCESS;
int running_gen = 0;
if (ap_scoreboard_image)
void *sb_shared;
void *sb_shared;
void ap_sync_scoreboard_image(void)
#ifdef SCOREBOARD_FILE
void update_scoreboard_global(void)
#ifdef SCOREBOARD_FILE
#ifdef HAVE_TIMES
int max_daemons_limit;
for (i = 0; i < max_daemons_limit; ++i)
int old_status;
if (child_num < 0)
if (ap_extended_status) {
return old_status;
status, r);
if (child_num < 0)
if (((x < 0) || (server_limit < x)) ||
((y < 0) || (thread_limit < y))) {
if ((x < 0) || (server_limit < x)) {