tdb API issues

Howard Chu hyc at
Fri Apr 3 02:30:45 GMT 2009

Howard Chu wrote:
>> It might also be possible to have a common virtual address space. To
>> do that we'd break up the tdb_context structure into per-thread and
>> per-process parts, and put the mapped pointers in the per-process
>> part. It would require some thought to make sure this is safe, but at
>> first glance I think its doable.
> OK, this sounds like a reasonable avenue to explore. If we also provide some
> callbacks for creating, locking/unlocking and freeing mutexes then we can
> explicitly make the relevant parts safe.

I have a preliminary patch up on 
Jeremy, I cc'd you on this because it looks like you're about to duplicate 
what I've just done re: adding thread callbacks in your libsmbclient proposal.

I'm not sure what's the point of OpenSSL asking the caller to pre-create some 
number of global locks; IMO the library should create whatever locks it needs 
and the caller shouldn't know about them at all. That's more the flavor of the 
approach I took, otherwise it's basically the same: the caller must call 
tdb_set_mutex() and provide it a structure which contains a table of mutex 
function pointers. The tdb_set_mutex() function will then create whatever 
locks it needs.

The trick from here on out is identifying where all the locks need to be inserted.

   -- Howard Chu
   CTO, Symas Corp. 
   Director, Highland Sun
   Chief Architect, OpenLDAP

More information about the samba-technical mailing list