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

Re: ldapsdk and pthreads: something is missing ?

At 10:06 AM 6/30/99 +0100, Wilbert de Graaf wrote:
Yesterday developed an ldap client that uses the ldap-sdk libraries that come with the OpenLDAP package (on linux). It worked fine. Next step for me was to make the client multithreaded using pthreads.

OpenLDAP 1.x -lldap is not threadaware nor threadsafe. You need
to provide synchronization necessary to serialize -lldap calls.

The threading part works. But as soon as I call ldap_search_s using the 'shared' "LDAP *ld" things go wrong. It seems there is support for multi-threaded clients, but I cannot get it to work. Do I need to add a define (POSIX_THREADS seems to be defined in portable.h) somewhere ? Or add flag or define while compiling the openldap sources, or my own sources ?

Only the servers are threaded... -lldap isn't.

When I ran (openldap) configure, it did find out pthreads are available.

Eventually, the application has to run on Irix 6.5. I saw in the Netscape SDK you need to do something with ldap_thread_fns structures, but I think it's not included / necessary with the Umich / OpenLDAP libraries. Am I right ?

We are developing a threaded version of the library -lldap_r. It
will use necessary threading functions directly. Those interested
in contributing to this development are encourged to raise appropriate
discussions on our -develop mailing list. (I hope to post a
proposed design there shortly).