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

RE: Mutex lock in libraries/libldap/tls.c

> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of VANHULLEBUS Yvan

> On Tue, Jun 11, 2002 at 10:03:41AM -0700, Kurt D. Zeilenga wrote:
> > I note that currently the API is designed such that
> > initialization of the API, destruction of the API, and LDAP
> > session initialization is to be serialized.  When the API is
> > used as design, there should not be a problem.

> In the "common" case:
> read_ldap_conf();
> set_ldap_conf();
> make_ldap_operations();
> close_ldap();
> exit;
> I agree that there should not be a problem.
> > Whether the API should be redesigned is another matter...
> As I said in my first post, some daemons which are ldap clients may
> need to set the LDAP configuration before each LDAP request (or each
> group of LDAP requests), as they can't be restarted each time the
> configuration is modified.
> I'm currently using such a daemon, and the only problems I noticed are
> relative to tls_def_ctx, and should all be corrected by my patchs.

> I understand if you don't modify the API design just for me, but
> perhaps other people/LDAP clients needs to implement such a case.

Given that the API currently works one particular way, it would make
more sense to me for you to mutex-protect the section of your daemon
that reloads the ldap.conf. Since it is a plain file, updates to it
are naturally serialized by the filesystem, so there's no reason for
multiple threads to attempt to load it, and certainly your own LDAP
operations should pause while the configuration is re-read.

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