test-aio-multithread: add performance comparison with thread-based mutexes
commitc05df34a874706946a918d320e602bb498550838
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 13 Feb 2017 18:12:41 +0000 (13 19:12 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 21 Feb 2017 11:39:40 +0000 (21 11:39 +0000)
treefeba2bc92fd0c73e7947be386693927f4cf60bbe
parent480cff632221dc4d4889bf72dd0f09cd35096bc1
test-aio-multithread: add performance comparison with thread-based mutexes

Add two implementations of the same benchmark as the previous patch,
but using pthreads.  One uses a normal QemuMutex, the other is Linux
only and implements a fair mutex based on MCS locks and futexes.
This shows that the slower performance of the 5-thread case is due to
the fairness of CoMutex, rather than to coroutines.  If fairness does
not matter, as is the case with two threads, CoMutex can actually be
faster than pthreads.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20170213181244.16297-4-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/test-aio-multithread.c