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

RE: Thread safety in OpenLdap API.

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Hagai Yaffe

> Hi,
> 	I am linking my application with the OpenLdap
> oldap32.lib & olber32.lib libraries in order to connect to
> Microsoft Active directory server using SSL and get data on
> users from it. my application is multi threaded but my
> threads do not share any data that is relevant to the
> OpenLdap libraries, each thread that needs info from the
> Active directory server connects to it and sends request's
> for the relevant info.
> i have looked in the OpenLdap documentation for thread-safety
> issues and could not find anything conclusive, what that I
> would like to know is if there is static / shared data that
> is kept at the OpenLdap libraries and might cause problem for
> me when two threads perform OpenLdap API calls at the same
> time (Using different LDAP * variables).

For Windows, the answer is "it depends." The MSVC project files are not
rigorously maintained, and are generally a mess. There are a number of
different build targets (the usual debug vs release, as well as static vs
DLL, and single vs multithreaded CRT) and so it can be a pain to work out
what you need. Finally, you should use the libldap_r library, which uses
mutexes to protect its global data. I don't recall what it's called in the
MSVC build.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support