Re: Relevant mailing list

Bulat Bulat bltsrc at
Sat Jun 4 19:28:13 UTC 2016

 Thanks, Matthew and Patrick.

I am currently reading about locking in kernel, mostly man pages and headers 
related to topic. That is various kinds of mutexes, rwlocks, shared locks, and the like.
Also I read boot - design and implementation of freebsd.

Then I started reading .c files and stuck on kern/subr_turnstile.
What the structure is and the purpose of it for me is understandable, how it is being
added when thread blocks and how it is being removed after wakeup().

However, the meaning of ts_free member in turnstile structure for me is unclear.
My understanding: when thread discovers than lock's turnstile is already present 
at turnstile chain it adds its own turnstile to lock's turnstile's ts_free
and after it wokes up it regrabs turnstile from the same
ts_free list of lock's turnstile. But why does it so, if it already has its own turnstile, what the 
meaning of putting of turnstile to free list only for regrabbing it later.


More information about the freebsd-questions mailing list