Threading libsmbclient - a proposal.

Derrell Lipman derrell.lipman at unwireduniverse.com
Fri Apr 3 16:51:05 GMT 2009


On Fri, Apr 3, 2009 at 12:27 PM, Jeremy Allison <jra at samba.org> wrote:

>
> The places that need locking are deep inside the utility
> code (name lookup, parameter reading etc.). So that's
> where the call must go. The entry points for adding the
> callback functions are smbc_XXX as I'm imagining the
> libsmbclient people will be the first users.
>

Ok.

>
> The nice thing about this is that it has zero impact
> on any of our other code (just some dummy function
> calls in the code paths).
>

And we probably want to avoid even that, particularly in areas of code that
are executed frequently. Function calls can be expensive. It's probably much
more efficient to say "if (func_ptr != NULL) (*func_ptr)(params);" than to
call a dummy function via func_ptr. That could all be hidden behind a macro,
though, so the code isn't cluttered by it.

Derrell


More information about the samba-technical mailing list