Date: Mon, 24 Jan 2011 16:04:21 -0500 From: John Baldwin <jhb@freebsd.org> To: David Xu <davidxu@freebsd.org> Cc: threads@freebsd.org Subject: Try upgrades and downgrades for POSIX rwlocks Message-ID: <201101241604.21451.jhb@freebsd.org>
next in thread | raw e-mail | index | archive | help
Does anyone know if there is a de facto or proposed standard for supporting upgrades and downgrades in POSIX rwlocks? IBM seems to support something rather gross where a wrlock() will succeed if the only shared lock is held by the current thread. But then the thread holds both a read and write lock, and it has to call unlock twice, the first to drop the write lock, the second to drop the read lock. If we were to add support for upgrades and downgrades I would prefer something more along the lines of our in-kernel APIs where there are try_upgrade() and downgrade() operations that convert a given lock between states. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101241604.21451.jhb>