Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2015 23:46:22 -0700
From:      Xin Li <delphij@delphij.net>
To:        Mateusz Guzik <mjguzik@gmail.com>, John Baldwin <jhb@freebsd.org>
Cc:        Alexander Kabaev <kabaev@gmail.com>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r282971 - in head/sys: kern sys
Message-ID:  <555ED0BE.2080602@delphij.net>
In-Reply-To: <20150521165826.GA17403@dft-labs.eu>
References:  <201505151350.t4FDocQT054144@svn.freebsd.org> <20150520120046.268dde86@kan> <2114957.Lbz1KNQfZU@ralph.baldwin.cx> <20150521165826.GA17403@dft-labs.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512



On 5/21/15 09:58, Mateusz Guzik wrote:
> In other words, I would argue modifying native privmitives to 
> accomodate for zfs use may not be the best course of action.

Well, POSIX says this about pthread_cond_destroy(), quote:

"A condition variable can be destroyed immediately after all the
threads that are blocked on it are awakened."

This is also supported by our userland thread library (libthr), by the
way, and I don't see this as an unreasonable expectation, as there is
no programmer accessible API to drain a conditional variable.

BTW. what ZFS code does is that it released the mutex (z_range_lock in
the zfs_rlock.c case), then did a broadcast, at which point the code
shall reasonably expect that all threads that are blocked on it are
awaken, and destroying the condition variable *must* be safe at the time
.

Cheers,
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVXtC8AAoJEJW2GBstM+nsvBwP/3lx99PDC+LDYXnZ4wE3bOxh
h7I/Sn7fSMO8UzsY6H9Wgaw9SvPzLbeCtAuild8prcmtkIBfX2AJ2Z3MhrmaZjR3
zaZJhOL3gHOip9YWy6nSUaKeFjKgpoA4VrvyOhVczBZ45FYElEseYbnnr+QYA4AZ
U9PsSDf23z72/iCebbxwCNZt07sAPj3UtmWQAP0iGPIlUkW8kyJMzHn9jwLfENnH
GgBb8C9o9ayBODNh/JfeMnyFylRLnK2GllP5p4zi2boKprKBrFgEVUVo72bhXjD0
zhk3+shXi3U99SuudR7+tRSHHJNeaAOnfPOyNF3EvRFPsIsU/sxZL+FHy4AePURp
7qFJeozEX4mphj5m4WOlX8NMZoEm3SwInVjmlnb0yaOVuLtFM+IUkguYHO2Ckb4X
byljvYGXHXKoFZQx4LN+YOdTAOF2xvNhmwB9scfBYI+tEAzIoakcPE1eeciLHmR5
jjLjW4MX8fgMtvBlVlh9XOre9J81Cgj5mxmBK3Z4KnuZD26yrjpn4ZauCI6/7vRN
c16mgsdC5lzmgheWhDAethg5oXO0r5xmapLOMMW3ZE4LZ7+L6bCvMsmAjcmVwOzQ
ftyO20wx5JTicaK0oPz9i31Szdm8c4z6B/GZdHbZJT+tdypo2WcO9/OLeqDjo3Jj
6prgPNxd72hHS4okdTSA
=KCdi
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?555ED0BE.2080602>