sys/tree.h sys/queue.h are they threadsafe?

Matthew Dillon dillon at
Sun May 29 11:40:19 PDT 2016

They are not, nor should they be, since their use cases under SMP tend to
already hold a lock for other reasons.  If you think about it, even if the
core routines were thread-safe, the caller's use cases are not going to be
thread safe unless the caller uses locks around its own use cases anyway.


On Sun, May 29, 2016 at 3:22 AM, Christoph Harder <shadowomf at>

> Hello,
> are QUEUE(3) and TREE(3) thread safe/atomic or ahould one use a lock when
> accessing them from multiple threads?
> Best regards,
> Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Users mailing list