[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Thread pool contexts and SLAPI

>> Is there a way we could extend libldap_r to return the thread
>> context for the current thread?
>That would be definitely useful. 

I'm about to commit a fix to this effect. The private API:

LDAP_F( void *)
ldap_pvt_thread_pool_context LDAP_P((
        ldap_pvt_thread_pool_t *pool ));

will return the current thread's contex, given a thread pool.

In order to implement this I needed to extend the thread abstraction
to support querying the identity of the current thread, as well as
keeping a list of active threads in the thread pool.

Finally, I also added support for the Sun ONE DS 5.x mutex and
condition API, which provides plugins targeted at both directory
servers with a portable synchronization API. 

>Is it okay to do the work in another thread? Then you could use
>ldap_pvt_thread_pool_submit() which will give you a working context.
>I had to resort to this trick so that I can read some configuration
>information from LDAP when slapd is coming up.

Interesting idea, I hadn't thought of that! Not spawning an extra
thread is probably to be preferred, though.


-- Luke

Luke Howard | PADL Software Pty Ltd | www.padl.com