tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Questions of lock usage in NetBSD kernel code



Hi,

I am a freshman in developing NetBSD drivers, and I have a question in
lock usage in NetBSD kernel code.

I find three kinds of locks which are often used in OpenBSD drivers,
namely "adaptive mutex lock", "spin mutex lock" and "rw lock".
I want to know  which locks can be held when the current thread can sleep.

I have read NetBSD man pages:
http://netbsd.gw.com/cgi-bin/man-cgi?mutex+9+NetBSD-current
http://netbsd.gw.com/cgi-bin/man-cgi?rwlock+9+NetBSD-current

I find two points:
(1) The "adaptive mutex lock" *can* be used in this situation.
(2) The "spin mutex lock" *can not* be used in this situation.

But I still have three questions:
(1) Are my points right?
(2) What about "rw lock"?
(3) What about other kinds of locks if they exist?

I am looking forward to useful opinions and answers :)


Thanks,
Jia-Ju Bai



Home | Main Index | Thread Index | Old Index