APR now provides the thread-specific child-pool directly to the
application. This fix changes the threaded MPM to use that child-pool
instead of trying to provide one itself. This should also reduce
(slightly) the memory requirements of each thread, as we're no longer
creating a child-pool and then not using it.
Tested under Linux 2.4.3 (rh7.1) with flood and ab to simulate
concurrent requests.
-aaron
Index: server/mpm/threaded/threaded.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/threaded/threaded.c,v
retrieving revision 1.47
diff -u -r1.47 threaded.c
--- server/mpm/threaded/threaded.c 2001/07/24 05:19:47 1.47
+++ server/mpm/threaded/threaded.c 2001/07/24 07:09:40
@@ -122,7 +122,6 @@
int pid;
int tid;
int sd;
- apr_pool_t *tpool; /* "pthread" would be confusing */
} proc_info;
/* Structure used to pass information to the thread responsible for
@@ -525,7 +524,7 @@
proc_info * ti = dummy;
int process_slot = ti->pid;
int thread_slot = ti->tid;
- apr_pool_t *tpool = ti->tpool;
+ apr_pool_t *tpool = apr_thread_pool_get(thd);
apr_socket_t *csd = NULL;
apr_pool_t *ptrans; /* Pool for per-transaction stuff */
apr_socket_t *sd = NULL;
@@ -645,7 +644,6 @@
apr_pool_clear(ptrans);
}
- apr_pool_destroy(tpool);
ap_update_child_status(process_slot, thread_slot, (dying) ? SERVER_DEAD :
SERVER_GRACEFUL,
(request_rec *) NULL);
dying = 1;
@@ -700,7 +698,6 @@
my_info->pid = my_child_num;
my_info->tid = i;
my_info->sd = 0;
- apr_pool_create(&my_info->tpool, pchild);
/* We are creating threads right now */
(void) ap_update_child_status(my_child_num, i, SERVER_STARTING,