new option: --with-thread-pool (default=no).
authoraland <aland>
Thu, 30 Mar 2000 21:52:36 +0000 (21:52 +0000)
committeraland <aland>
Thu, 30 Mar 2000 21:52:36 +0000 (21:52 +0000)
If set, use a pool of threads to handle requests, instead of
spawning a new thread per request.  There's no code to handle this
right now, but there will be, soon.

acconfig.h
configure.in

index 800a20a..8bfd84d 100644 (file)
@@ -56,8 +56,6 @@ config.h - created by autoconf; contains defines generated by autoconf
 /* uint32_t should be the canonical 'network integer' */
 #undef uint32_t
 
-@BOTTOM@
-
 /* Define if prototype for strncasecmp needed */
 #undef NEED_DECLARATION_STRNCASECMP
 
@@ -79,4 +77,7 @@ config.h - created by autoconf; contains defines generated by autoconf
 /* Define if prototype for endusershell needed */
 #undef NEED_DECLARATION_ENDUSERSHELL
 
+/* use a pool of threads to handle requests, instead of spawning threads? */
+#undef WITH_THREAD_POOL
 
+@BOTTOM@
index 162f7a8..c1eba06 100644 (file)
@@ -246,6 +246,16 @@ AC_ARG_WITH(threads,
   esac ]
 )
 
+dnl extra argument: --with-thread-pool
+WITH_THREAD_POOL=no
+AC_ARG_WITH(thread-pool,
+[  --with-thread-pool      Use a pool of threads for high-load systems.  (default=no) ],
+[ case "$withval" in
+    *)
+       WITH_THREAD_POOL=$withval
+  esac ]
+)
+
 dnl See what include-style is used by the make program.
 dnl AC_MSG_CHECKING(include style for make)
 dnl echo "include /dev/null" > testmake.$$
@@ -291,6 +301,7 @@ dnl #
 dnl #############################################################
 
 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
+PTHREADLIB=
 if test "$WITH_THREADS" = "yes"; then 
   AC_CHECK_HEADERS(pthread.h)
   AC_CHECK_LIB(pthread, pthread_create,
@@ -304,6 +315,18 @@ if test "$WITH_THREADS" = "yes"; then
   AC_SUBST(PTHREADLIB)
 fi
 
+dnl If using thread pools, check that threading is enabled
+if test "$WITH_THREADS" != "yes"; then
+  AC_MSG_ERROR(You must have threads enabled for thread pools to work.)
+fi
+
+dnl If using thread pools, check that we have thread libraries
+if test "X$PTHREADLIB" = "X"; then
+  AC_MSG_ERROR(You must have threading libraries for thread pools to work.)
+fi
+
+AC_DEFINE(WITH_THREAD_POOL,1)
+
 dnl Check for -lsocket
 AC_CHECK_LIB(socket, getsockname,
   SOCKETLIB="-lsocket"