[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: no. of available threads
I don't think such an API exists.
You could extend the thread pool API in libraries/libldap_r/tpool.c
with something akin to the following (completely untested, of course):
int
ldap_pvt_thread_pool_availablethreads( ldap_pvt_thread_pool_t *tpool )
{
struct ldap_int_thread_pool_s *pool;
int ret;
if (tpool == NULL)
return -1;
pool = *tpool;
if (pool == NULL)
return -1;
ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
ret = pool->ltp_max_count - pool->ltp_open_count;
ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
return ret;
}
-- Luke
>From: June Sup Lee <june@ISI.EDU>
>Subject: no. of available threads
>To: openldap-devel@OpenLDAP.org
>Cc: june@ISI.EDU (June Sup Lee)
>Date: Mon, 27 Jan 2003 17:20:07 -0800 (PST)
>
>Is there a library function to get the number of available
>worker threads? I have a slapd which contains multiple backends, where
>one backend ldapsearches the others. If all the threads are already taken
>when backend A ldapsearches backend B, this search hangs until the timelimit
>because slapd can't find an available thread for backend B.
>
>June
>
--
Luke Howard | PADL Software Pty Ltd | www.padl.com