OpenLDAP 2.0.x's libldap_r

Stig Venaas Stig.Venaas at uninett.no
Sun Jul 15 10:31:38 CEST 2001


On Sun, Jul 15, 2001 at 01:19:35AM +0200, Michael Ströder wrote:
> HI!
> 
> While we're at it: One thing which might bite other python-ldap
> developers as well is that the OpenLDAP libs are not reentrant.
> Despite the ugly hack with my wrapper module ldapthreadlock the
> problem is still not really solved.

I don't know much about this, it is something that I'll have to
look into for PHP as well when it's used with Apache 2.0 etc.
I generally thought that the API was thread safe if one made
sure all threads used different links, and that the _r lib was
for the case with several on the same link. But this is more or
less guessing. The new API is more threading friendly since there
are less use of static buffers. I can't think of any place with
static buffers right now.

One way of writing the Python LDAP API might be to map the low
level Python functions and write some higher level functions in
Python if they are needed. PHP has both high and low level LDAP
functions, but they are all written in C. And I suppose we should
try to make that thread safe.

I have still not looked at the Python API, so I don't really know
what I'm talking about (:

Stig





More information about the python-ldap mailing list