Use turnstile to implement sx_lock

prime guomingyan at gmail.com
Thu Dec 15 06:52:37 PST 2005


hi hackers,
I want to use turnstile to implement sx_lock( or read/write  lock),but
find that there is a big obstacle,
ONE sx_lock needs TWO queues to put waiters on,one for readers and the
other one for writers,but ONE turnstile can only supply ONE queue,and ONE
sx_lock can only get ONE turnstile.

I read opensolaris' rw_lock implementation and find that its turnstile
has TWO queues which is different from FreeBSD's turnstile.

Are there any good ideas to bypass the obstacle? Thanks very much.

--
Three passions, simple but overwhelmingly strong, have governed my life:
the longing for love, the search for knowledge, and unbearable pity for
the suffering of mankind.
                         ---------Bertrand Russell


More information about the freebsd-hackers mailing list