Changes with Apache 2.0.12-dev
+ *) Rename mpmt_pthread to threaded. This is more in line with the
+ fact that mpmt_pthread shouldn't be using pthreads directly, and
+ it is a smaller name that doesn't tie into anything.
+ [Ryan Bloom]
+
*) Rename the module structures so that the exported symbol matches
the file name, and it is easier to automate the installation
process (generating LoadModule directives from the module filenames).
MaxSpareServers 10
</IfModule>
-<IfModule mpmt_pthread.c>
+<IfModule threaded.c>
MaxClients 8
StartServers 1
MinSpareThreads 5
# MaxSpareThreads ...... maximum number of worker threads which are kept spare
# ThreadsPerChild ...... constant number of worker threads in each server process
# MaxRequestsPerChild .. maximum number of requests a server process serves
-<IfModule mpmt_pthread.c>
+<IfModule threaded.c>
StartServers 5
MaxClients 8
MinSpareThreads 5
<DL>
<DT><A HREF="core.html">Core</A>
<DD>Core Apache features.
-<DT><A HREF="mpmt_pthread.html">mpmt_pthread</A>
+<DT><A HREF="threaded.html">threaded</A>
<DD>Multi-Processing Module with Threading via Pthreads; Variable number
of processes, constant number of threads/child
<DT><a href="mpm_winnt.html">mpm_winnt</a>
<DL>
<DT><A HREF="core.html">Core</A>
<DD>Core Apache features.
-<DT><A HREF="mpmt_pthread.html">mpmt_pthread</A>
+<DT><A HREF="threaded.html">threaded</A>
<DD>Multi-Processing Module with Threading via Pthreads; Variable number
of processes, constant number of threads/child
<DT><a href="mpm_winnt.html">mpm_winnt</a>
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
<p>This controls the directory to which Apache attempts to switch
before dumping core. The default is in the <A
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
The Group directive sets the group under which the server will answer requests.
In order to use this directive, the stand-alone server must be run initially
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
<p>The PidFile directive sets the file to which the server records the
process id of the daemon. If the filename does not begin with a slash
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
<P>The Listen directive instructs Apache to listen to only specific IP
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
<P>The maximum length of the queue of pending connections. Generally no
tuning is needed or desired, however on some systems it is desirable
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
<p>The LockFile directive sets the path to the lockfile used when
Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, prefork</p>
<P>The MaxClients directive sets the limit on the number of child
processes that will be created to serve requests. When the server is
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, prefork, perchild, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, prefork, perchild, mpm_winnt</p>
<p>The MaxRequestsPerChild directive sets the limit on the number of requests
that an individual child server process will handle. After MaxRequestsPerChild
<A
HREF="directive-dict.html#Default"
REL="Help"
-><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 10 (Perchild) or 500 (Mpmt_pthread) </CODE><BR>
+><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 10 (Perchild) or 500 (threaded) </CODE><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild</p>
+><STRONG>Module:</STRONG></A> threaded, perchild</p>
<P>Maximum number of idle threads. Different MPMs deal with this directive
differently. Perchild monitor the number of idle threads on a
per-child basis. If there are too many idle threads in that child, the server
will begin to kill threads within that child.</P>
-<P>Mpmt_pthread deals with idle threads on a server-wide basis. If there are
+<P>threaded deals with idle threads on a server-wide basis. If there are
too many idle threads in the server then child processes are killed
until the number of idle threads is less than this number.</p>
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild</p>
+><STRONG>Module:</STRONG></A> threaded, perchild</p>
<P>Maximum number of threads per child. For MPMs with a variable
number of threads per child, this directive sets the maximum number of
<A
HREF="directive-dict.html#Default"
REL="Help"
-><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 5 (Perchild) or 250 (Mpmt_pthread) </CODE><BR>
+><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 5 (Perchild) or 250 (threaded) </CODE><BR>
<A
HREF="directive-dict.html#Context"
REL="Help"
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild</p>
+><STRONG>Module:</STRONG></A> threaded, perchild</p>
<P>Minimum number of idle threads to handle request spikes. Different MPMs
deal with this directive differently. Perchild monitor the number
of idle threads on a per-child basis. If there aren't enough idle threads in
that child, the server will begin to create new threads within that child.
</P>
-<P>Mpmt_pthread deals with idle threads on a server-wide basis. If there
+<P>threaded deals with idle threads on a server-wide basis. If there
aren't enough idle threads in the server then child processes are created
until the number of idle threads is greater than number.</p>
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
<p>The ScoreBoardFile directive is required on some architectures to place
a file that the server will use to communicate between its children and
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
The server will set the TCP buffer size to the number of bytes
specified. Very useful to increase past standard OS defaults on high
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, prefork</p>
<p>The StartServers directive sets the number of child server processes created
on startup. As the number of processes is dynamically controlled depending
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, mpm_winnt</p>
+><STRONG>Module:</STRONG></A> threaded, mpm_winnt</p>
<P>This directive sets the number of threads created by each child
process. The child creates these threads at startup and never creates
more. if using an MPM like mpmt_winnt, where there is only one child process,
this number should be high enough to handle the entire load of the server.
-If using an MPM like mpmt_pthread, where there are multiple child processes,
+If using an MPM like threaded, where there are multiple child processes,
the total number of threads should be high enough to handle the common load
on the server.</p>
<A
HREF="directive-dict.html#Module"
REL="Help"
-><STRONG>Module:</STRONG></A> mpmt_pthread, perchild, prefork</p>
+><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
The User directive sets the userid as which the server will answer requests.
In order to use this directive, the standalone server must be run initially
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
-<TITLE>Apache MPM mpmt_pthread</TITLE>
+<TITLE>Apache MPM prefork</TITLE>
</HEAD>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
-<TITLE>Apache MPM mpmt_pthread</TITLE>
+<TITLE>Apache MPM threaded</TITLE>
</HEAD>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
>
<!--#include virtual="header.html" -->
-<H1 ALIGN="CENTER">Multi-Processing Module mpmt_pthread</H1>
+<H1 ALIGN="CENTER">Multi-Processing Module threaded</H1>
<P>
This Multi-Processing Module implements a hybrid multi-threaded
multi-process web server.
<A
HREF="module-dict.html#SourceFile"
REL="Help"
-><STRONG>Source File:</STRONG></A> mpmt_pthread.c
+><STRONG>Source File:</STRONG></A> threaded.c
<BR>
<A
HREF="module-dict.html#ModuleIdentifier"
REL="Help"
-><STRONG>Module Identifier:</STRONG></A> mpm_mpmt_pthread_module
+><STRONG>Module Identifier:</STRONG></A> mpm_threaded_module
</P>
<H2>Summary</H2>
<li>The server can be better customized for the needs of the
particular site. For example, sites that need a great deal of
scalability can choose to use a threaded MPM like <a
-href="mod/mpmt_pthread.html">mpmt_pthread</a>, while sites requiring
+href="mod/threaded.html">threaded</a>, while sites requiring
stability or compatibility with older software can use a <a
href="mod/prefork.html">preforking MPM</a>. In addition, special
features like serving different hosts under different userids
<ul>
<li> BeOS: mpmt_beos</li>
<li> OS/2: spmt_os2</li>
- <li> Unix: mpmt_pthread </li>
+ <li> Unix: threaded </li>
<li> Windows: winnt</li>
</ul>
<li>The server can be better customized for the needs of the
particular site. For example, sites that need a great deal of
scalability can choose to use a threaded MPM like <a
-href="mod/mpmt_pthread.html">mpmt_pthread</a>, while sites requiring
+href="mod/threaded.html">threaded</a>, while sites requiring
stability or compatibility with older software can use a <a
href="mod/prefork.html">preforking MPM</a>. In addition, special
features like serving different hosts under different userids
<ul>
<li> BeOS: mpmt_beos</li>
<li> OS/2: spmt_os2</li>
- <li> Unix: mpmt_pthread </li>
+ <li> Unix: threaded </li>
<li> Windows: winnt</li>
</ul>
LTFLAGS="$LTFLAGS -export-dynamic"
-if test "$apache_cv_mpm" = "mpmt_pthread" -o "$apache_cv_mpm" = "dexter"; then
+if test "$apache_cv_mpm" = "threaded" -o "$apache_cv_mpm" = "perchild"; then
# if we are using a threaded MPM, we will get better performance with
# mod_cgid, so make it the default.
APACHE_MODULE(cgid, CGI scripts, , , yes)
perchild ...... Multi Process Model with Threading via Pthreads
Constant number of processes, variable number of threads
each child process can have a different uid/gid.
- mpmt_pthread .. Multi Process Model with Threading via Pthreads
+ threaded ...... Multi Process Model with Threading via Pthreads
Variable number of processes, constant number of
threads/child (= Apache/pthread)
spmt_os2 ...... Single Process Model with Threading on OS/2
AC_MSG_CHECKING(which MPM to use)
AC_ARG_WITH(mpm,
[ --with-mpm=MPM Choose the process model for Apache to use.
- MPM={beos,mpmt_pthread,prefork,spmt_os2,perchild}],[
+ MPM={beos,threaded,prefork,spmt_os2,perchild}],[
APACHE_MPM=$withval
],[
if test "x$APACHE_MPM" = "x"; then
- APACHE_MPM=mpmt_pthread
+ APACHE_MPM=threaded
fi
])
AC_MSG_RESULT($APACHE_MPM)
apache_cv_mpm=$APACHE_MPM
-if test "$apache_cv_mpm" = "mpmt_pthread" -o "$apache_cv_mpm" = "perchild"; then
+if test "$apache_cv_mpm" = "threaded" -o "$apache_cv_mpm" = "perchild"; then
PTHREADS_CHECK
AC_MSG_CHECKING([for which threading library to use])
AC_MSG_RESULT($threads_result)
+++ /dev/null
-
-LTLIBRARY_NAME = libmpmt_pthread.la
-LTLIBRARY_SOURCES = mpmt_pthread.c
-
-include $(top_srcdir)/build/ltlib.mk
+++ /dev/null
-This is a place-holder which indicates to Configure that it shouldn't
-provide the default targets when building the Makefile in this directory.
-Instead it'll just prepend all the important variable definitions, and
-copy the Makefile.tmpl onto the end.
--- /dev/null
+
+LTLIBRARY_NAME = libthreaded.la
+LTLIBRARY_SOURCES = threaded.c
+
+include $(top_srcdir)/build/ltlib.mk
dnl ## XXX - Need a more thorough check of the proper flags to use
-if test "$MPM_NAME" = "mpmt_pthread" ; then
+if test "$MPM_NAME" = "threaded" ; then
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
#include "scoreboard.h"
#include "unixd.h"
-#ifndef APACHE_MPM_MPMT_PTHREAD_H
-#define APACHE_MPM_MPMT_PTHREAD_H
+#ifndef APACHE_MPM_THREADED_H
+#define APACHE_MPM_THREADED_H
-#define MPMT_PTHREAD_MPM
+#define THREADED_MPM
#define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
extern server_rec *ap_server_conf;
extern char ap_coredump_dir[MAX_STRING_LEN];
-#endif /* APACHE_MPM_MPMT_PTHREAD_H */
+#endif /* APACHE_MPM_THREADED_H */
return 0;
}
-static void mpmt_pthread_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
+static void threaded_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
{
static int restart_num = 0;
int no_detach = 0;
apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
}
-static void mpmt_pthread_hooks(apr_pool_t *p)
+static void threaded_hooks(apr_pool_t *p)
{
one_process = 0;
- ap_hook_pre_config(mpmt_pthread_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_pre_config(threaded_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
}
return NULL;
}
-static const command_rec mpmt_pthread_cmds[] = {
+static const command_rec threaded_cmds[] = {
UNIX_DAEMON_COMMANDS
LISTEN_COMMANDS
AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
{ NULL }
};
-module AP_MODULE_DECLARE_DATA mpm_mpmt_pthread_module = {
+module AP_MODULE_DECLARE_DATA mpm_threaded_module = {
MPM20_MODULE_STUFF,
NULL, /* hook to run before apache parses args */
NULL, /* create per-directory config structure */
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- mpmt_pthread_cmds, /* command apr_table_t */
- mpmt_pthread_hooks /* register_hooks */
+ threaded_cmds, /* command apr_table_t */
+ threaded_hooks /* register_hooks */
};