[Date Prev][Date Next]
RE: Multi-threaded Client Development With libldap_r
Howard, in looking at the back-ldap source, it looks like it's safe for
multiple threads to simultaneously use a single LDAP handle for searching in
2.2.x. Is that correct? I did notice some mutex code in the places you'd
usually see thread synchronization being performed (bind.c, init.c,
unbind.c), however it was hard for me to discern what functions I should be
"extremely careful" when calling besides the usual suspects (those used
during bind and unbind operations, for example)...can you give me a short
rundown on what I should specifically watch out for?
From: Howard Chu [mailto:firstname.lastname@example.org]
Sent: Thursday, January 29, 2004 4:46 PM
To: 'Jason Raneses'; openldap-software@OpenLDAP.org
Subject: RE: Multi-threaded Client Development With libldap_r
libldap_r still provides only very rudimentary thread support; enough to
slapd and slurpd work. The 2.2 library is slightly more flexible than 2.1; I
added enough to it to allow back-ldap to perform multiple LDAP operations
over a single handle. However, you need to be Extremely Careful about what
functions you call. I suggest you read the 2.2 back-ldap source code to see
what is known to work. You're of course welcome to try anything you like and
fix whatever problems you encounter.
There was someone on the -devel list who had talked about implementing the
rest of the proposed thread-safety features but I've never seen a code
submission so I have no idea where that went.
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
Symas: Premier OpenSource Development and Support
[mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Jason Raneses
I'm developing a library which uses libldap_r and it must service
simultaneous search requests on a single open connection. These search
requests must all access one LDAP handle at the same time and must be able
concurrently return results with out blocking.
Is this type of functionality currently possible to develop using libldap_r?
A lot of documentation I've been able to find about the library states that
it is thread-safe; however, I've read some archived list posting that state
Kurt posted a response to a similar question back in January 2002, but I'm
not sure if the answer given still holds true today:
There was also a recent conversation on the dev mailing list about this
If the answer is "no, it's not directly supported", is there anything
available similar to the functionality in the Mozilla LDAP C libraries that
can be tied into (ldap_thread_fns, etc.)?
Thanks in advance,