[libvirt] [PATCH 1/3] virthread: Introduce virRWLockInitPreferWriter
Pavel Hrdina
phrdina at redhat.com
Sun Jul 23 17:25:37 UTC 2017
On Wed, Jul 19, 2017 at 04:31:48PM +0200, Michal Privoznik wrote:
> We already have virRWLockInit. But this uses pthread defaults
> which prefer reader to initialize the RW lock. This may lead to
> writer starvation. Therefore we need to have the counterpart that
> prefers writers. Now, according to the
> pthread_rwlockattr_setkind_np() man page setting
> PTHREAD_RWLOCK_PREFER_WRITER_NP attribute is no-op. Therefore we
> need to use PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
> attribute. So much for good enum value names.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/libvirt_private.syms | 1 +
> src/util/virthread.c | 35 +++++++++++++++++++++++++++++++++++
> src/util/virthread.h | 1 +
> 3 files changed, 37 insertions(+)
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170723/f1e95f17/attachment-0001.sig>
More information about the libvir-list
mailing list