[PATCH] tevent and threads - infrastructure improvements - version #2

Jeremy Allison jra at samba.org
Tue Sep 15 18:29:42 UTC 2015

On Tue, Sep 15, 2015 at 02:27:12PM -0400, Ira Cooper wrote:
> > + at section context Tevent with threads
> > +
> > +In order to use tevent with threads, you must first understand
> > +how to use the talloc library in threaded programs. For more
> > +information about working with talloc, please visit <a
> > +href="http://talloc.samba.org/">talloc website</a> where tutorial and
> > +documentation are located.
> > +
> > +If a tevent context structure is talloced from a NULL, thread-safe talloc
> > +context, then it can be safe to use in a threaded program. The function
> > +<code>talloc_disable_null_tracking()</code> <b>must</b> be called from the initial
> > +program thread before any talloc calls are made to ensure talloc is
> > thread-safe.
> I don't understand the first sentence of the paragraph above.
> And I understand the rest right... Handling talloc and non-main threads
> wanting to return data to the main thread will be possible :).

Yes. That's exactly what the test programs do.

> No hacks like what we have in vfs_glusterfs, that can go away?

Yep, I think so ! Maybe we can chat next week
at SDC about this.

More information about the samba-technical mailing list