tech-kern archive

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

Re: NetBSD vs Solaris condvar semantics

On Sun, Oct 14, 2012 at 07:20:02AM +0000, Taylor R Campbell wrote:
 > I'm working on fixing ZFS locking, and I ran into a diference between
 > NetBSD's and Solaris's interpretation of condvars.
 > In Solaris, it seems to be kosher to do
 >    cv_broadcast(cv);
 >    cv_destroy(cv);
 > at least if waiters use only cv_wait and not cv_wait_sig &c.  That
 > idiom makes NetBSD very unhappy, though, because cv_wait wants to
 > continue using cv after it is woken, at which point cv may already be
 > destroyed.
 > ZFS makes nontrivial use of this idiom, such as in dirent locks and
 > range locks.

It is wrong. If possible we should fix ZFS. If not, the next best
approach is to provide a separate cv implementation for ZFS that
allows callers to do skanky things without producing nasal demons.

David A. Holland

Home | Main Index | Thread Index | Old Index