[Date Prev][Date Next]
Thread pool contexts and SLAPI
- To: openldap-devel@OpenLDAP.org
- Subject: Thread pool contexts and SLAPI
- From: Luke Howard <lukeh@PADL.COM>
- Date: Fri, 24 Jan 2003 00:23:33 +1100
- Organization: PADL Software Pty Ltd
- Versions: dmail (bsd44) 2.4c/makemail 2.9d
I'm running up against a nasty problem in SLAPI.
The slapi_search_internal() function can be used by plugins
to perform an internal search. It does not take any arguments
that contain any context of the caller.
Inside slapi_search_internal(), fakeConnection() is used to
create internal connection and operation contexts on which to
perform the search.
The problem is that this blows up badly with back-bdb (sending
it spinning) because op->o_threadctx is NULL, and it needs some
thread-specific data in order to get a lock context.
I'm between a rock and a hard place: I can't change the SLAPI
API to pass any context information (which would easily solve
the problem as the caller will have access to the original
Operation and thus its thread context) Changing the SLAPI API
would break API/ABI compatability with Netscape/Sun ONE, which
But I don't know what else to do... I presume that the thread
pools maintain their own TSD for portability, but using
pthread_getspecific() would presumably have pushed the
problem out of slapd's domain...
And things were going so well too...
Luke Howard | PADL Software Pty Ltd | www.padl.com