Shared/exclusive (rw) locks

Tim Robbins tjr at freebsd.org
Tue Jul 6 00:13:32 PDT 2004


On Tue, Jul 06, 2004 at 12:45:27PM +0600, ngl wrote:
> That means, freebsd stable has no spin rwlocks ?

Right. Reader-writer spinlocks would not be very useful in FreeBSD 4; because
only one thread can be running in the kernel at once, the only opportunity
you'd have to share reader locks would be if you slept while holding a
spinlock, which is a bad idea (and not permitted by FreeBSD 5 or Linux).
If you want -rwlocks, you'll have to use lockmgr() (which is a sleep lock).


Tim


More information about the freebsd-stable mailing list