diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-07 19:45:48 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2008-05-07 19:45:48 +0000 |
commit | 40d30840f5fa381a48eb531bb57b991a303fa433 (patch) | |
tree | 44e6be30ce64e290e9c251fc8bd92ac812e26e48 /include | |
parent | ec5ee5e4de0c4e38fa40f2bb008f8bf212983ef3 (diff) | |
download | libapr-util-40d30840f5fa381a48eb531bb57b991a303fa433.tar.gz |
* The idle thread timeout statistic was being incremented each time an
idle thread (whether a timeout was set or not) was reaped. Updated
the check to only increment when a timeout was set.
* The test to determine if a thread should go into probation was >=
when it should have been just > since the idle_cnt has been incremented
by the time this test is made.
PR: 43876
Submitted by: Joe Mudd <Joe.Mudd sas.com>
Reviewed by: Henry Jen
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@654234 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/apr_thread_pool.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/apr_thread_pool.h b/include/apr_thread_pool.h index 1a9195b5..cbf382b3 100644 --- a/include/apr_thread_pool.h +++ b/include/apr_thread_pool.h @@ -187,6 +187,38 @@ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** + * Get number of tasks that have run + * @param me The thread pool + * @return Number of tasks that have run + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_tasks_run_count(apr_thread_pool_t * me); + +/** + * Get high water mark of the number of tasks waiting to run + * @param me The thread pool + * @return High water mark of tasks waiting to run + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_tasks_high_count(apr_thread_pool_t * me); + +/** + * Get high water mark of the number of threads + * @param me The thread pool + * @return High water mark of threads in thread pool + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_threads_high_count(apr_thread_pool_t * me); + +/** + * Get the number of idle threads that were destroyed after timing out + * @param me The thread pool + * @return Number of idle threads that timed out + */ +APU_DECLARE(apr_size_t) + apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); + +/** * Access function for the maximum number of idle threads * @param me The thread pool * @return The current maximum number @@ -203,6 +235,29 @@ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** + * Access function for the maximum wait time (in microseconds) of an + * idling thread that exceeds the maximum number of idling threads. + * A non-zero value allows for the reaping of idling threads to shrink + * over time. Which helps reduce thrashing. + * @param me The thread pool + * @param timeout The number of microseconds an idle thread should wait + * till it reaps itself + * @return The original maximum wait time + */ +APU_DECLARE(apr_interval_time_t) + apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, + apr_interval_time_t timeout); + +/** + * Access function for the maximum wait time (in microseconds) of an + * idling thread that exceeds the maximum number of idling threads + * @param me The thread pool + * @return The current maximum wait time + */ +APU_DECLARE(apr_interval_time_t) + apr_thread_pool_idle_wait_get(apr_thread_pool_t * me); + +/** * Access function for the maximum number of threads * @param me The thread pool * @return The current maximum number |