R: tdb API issues

Diego Zuccato diego.zuccato at unibo.it
Thu Apr 2 06:37:06 GMT 2009

> 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.
What about using a single thread for tdb access?
Who uses GTK is already used to such a scheme (only one thread handles the GUI, others just setup requests with callbacks). The API impact is minimal (could even be limited to an external library) and there's no additional dependency on threading libraries if the threading API is not linked in (obvious if the "external library" path is chosen).
Extra functions would be something like an "init" that spawns a thread and a series of wrappers that do the proper locking/unlocking and data handling, communicating with the handler thread.
Often harder to explain than to do it... :-)


More information about the samba-technical mailing list