Chris Kirby wrote: > But doesn't the rw_enter code block if there's a waiting > writer? In other words, can't we cause a deadlock > if we already hold the read lock, there's a waiting writer, > and we try to grab the read lock again? >
FYI, the krwlock_t implementation in ZFS's kernel.c specifically asserts if a thread tries to grab an rwlock twice as a reader, which indicates this is undesired behaviour (although it won't detect if another thread also grabs the lock in between those two rw_enter() calls). Regards, Ricardo -- <http://www.sun.com> *Ricardo Manuel Correia* Lustre Engineering *Sun Microsystems, Inc.* Portugal -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-code/attachments/20071127/25adc29b/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: 6g_top.gif Type: image/gif Size: 1257 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/zfs-code/attachments/20071127/25adc29b/attachment.gif>