ap_mpm.h revision f062ed7bd262a37a909dd77ce5fc23b446818823
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin/* ====================================================================
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * The Apache Software License, Version 1.1
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * Copyright (c) 2000 The Apache Software Foundation. All rights
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * reserved.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * Redistribution and use in source and binary forms, with or without
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * modification, are permitted provided that the following conditions
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * 1. Redistributions of source code must retain the above copyright
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * notice, this list of conditions and the following disclaimer.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * 2. Redistributions in binary form must reproduce the above copyright
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * notice, this list of conditions and the following disclaimer in
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * the documentation and/or other materials provided with the
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * distribution.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * 3. The end-user documentation included with the redistribution,
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * if any, must include the following acknowledgment:
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * "This product includes software developed by the
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * Apache Software Foundation (http://www.apache.org/)."
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * Alternately, this acknowledgment may appear in the software itself,
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * if and wherever such third-party acknowledgments normally appear.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * 4. The names "Apache" and "Apache Software Foundation" must
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * not be used to endorse or promote products derived from this
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * software without prior written permission. For written
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * permission, please contact apache@apache.org.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * 5. Products derived from this software may not be called "Apache",
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * nor may "Apache" appear in their name, without prior written
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * permission of the Apache Software Foundation.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * SUCH DAMAGE.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * ====================================================================
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * This software consists of voluntary contributions made by many
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * individuals on behalf of the Apache Software Foundation. For more
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin * information on the Apache Software Foundation, please see
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin The MPM, "multi-processing model" provides an abstraction of the
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin interface with the OS for distributing incoming connections to
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin threads/process for processing. http_main invokes the MPM, and
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin the MPM runs until a shutdown/restart has been indicated.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin The MPM calls out to the apache core via the ap_process_connection
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin function when a connection arrives.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin The MPM may or may not be multithreaded. In the event that it is
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin multithreaded, at any instant it guarantees a 1:1 mapping of threads
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin ap_process_connection invocations.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin Note: In the future it will be possible for ap_process_connection
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin to return to the MPM prior to finishing the entire connection; and
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin the MPM will proceed with asynchronous handling for the connection;
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin in the future the MPM may call ap_process_connection again -- but
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin does not guarantee it will occur on the same thread as the first call.
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin The MPM further guarantees that no asynchronous behaviour such as
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin longjmps and signals will interfere with the user code that is
b45c2b86612fd10c2b08965bb99e66a3c0e43480minfrin invoked through ap_process_connection. The MPM may reserve some
void ap_start_shutdown(void);
#ifdef HAS_OTHER_CHILD
int write_fd);