diff options
| author | Paolo Bonzini | 2015-08-12 15:38:18 +0200 |
|---|---|---|
| committer | Stefan Weil | 2015-09-24 20:52:28 +0200 |
| commit | 7c9b2bf67775ecc1359ce973580807d173e7f710 (patch) | |
| tree | 344a675e9af8e8885444247dc18aab45710bdcc0 /include | |
| parent | slirp: Fix non blocking connect for w32 (diff) | |
| download | qemu-7c9b2bf67775ecc1359ce973580807d173e7f710.tar.gz qemu-7c9b2bf67775ecc1359ce973580807d173e7f710.tar.xz qemu-7c9b2bf67775ecc1359ce973580807d173e7f710.zip | |
qemu-thread: add a fast path to the Win32 QemuEvent
QemuEvents are used heavily by call_rcu. We do not want them to be slow,
but the current implementation does a kernel call on every invocation
of qemu_event_* and won't cut it.
So, wrap a Win32 manual-reset event with a fast userspace path. The
states and transitions are the same as for the futex and mutex/condvar
implementations, but the slow path is different of course. The idea
is to reset the Win32 event lazily, as part of a test-reset-test-wait
sequence. Such a sequence is, indeed, how QemuEvents are used by
RCU and other subsystems!
The patch includes a formal model of the algorithm.
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/qemu/thread-win32.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h index 3d58081bed..385ff5f76a 100644 --- a/include/qemu/thread-win32.h +++ b/include/qemu/thread-win32.h @@ -18,6 +18,7 @@ struct QemuSemaphore { }; struct QemuEvent { + int value; HANDLE event; }; |
