[PATCH] talloc with threads tutorial and tests

Simo simo at samba.org
Mon Mar 16 13:36:11 MDT 2015


On Mon, 2015-03-16 at 12:28 -0700, Jeremy Allison wrote:
> So one of the things that came up at the Vault
> conference in conversations with Jeff was the
> real lack of a guide on how to use talloc in
> pthreaded code.
> 
> Here is an attempt to fix that, plus a test
> case added to smbtorture local.talloc to ensure
> talloc works correctly in a threaded environment.
> 
> Please review and comment/push !
> 
> Thanks,
> 
> 	Jeremy.

+10!

Very nice to see this.

Aside:
Jeremy would you like a method of passing a context that avoids shared
variables and mutexes and uses instead a pipe for synchronization ?
I think it's be neat and simpler to use, perhaps even more performant as
you do not get many threads contending on a single variable, but with
the downside of requiring a pipe between main thread and each sub
thread.

Simo.

-- 
Simo Sorce



More information about the samba-technical mailing list