Jianwei Gao
|
How does the thread_pool_limits() work?
|
Jianwei Gao
04/21/2009 10:31 AM
post27627
|
How does the thread_pool_limits() work?
In a resource manager, I tried to control the thread number in the thread pool by thread_pool_limits as below,
/* make resource manager single threaded */
thread_pool_limits(tpp, 0, 0, 1, 1, 0);
/* do something */
/* return the thread pool to its initial state */
thread_pool_limits(tpp, 3, 4, 5, 1, THREAD_POOL_CONTROL_NONBLOCK);
Normally, it works fine. However, if the system is very busy, the second call to thread_pool_limits was blocked. By
using pidin, I saw 12 threads in thread pool, even the maximum thread number is set to 5 in thread_pool_limits(). And
the function thread_pool_limits() will return until all other threads finish execution. Is it normal?
Thanks,
Jianwei
|
|
|