|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 3/8] qemu-thread-win32: cleanup, fix, document QemuEvent |
Date: | Mon, 6 Mar 2023 16:17:45 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 3/6/23 15:32, David Hildenbrand wrote:
Thinking more about it, the intended usage of QemuEvent is either qemu_event_reset(); if (!check()) { qemu_event_wait()); } or if (!check()) { qemu_event_reset(); if (!check()) { qemu_event_wait()); } } If we don't care on the reset path we care much less on the wait path.Should I remove it and go straight to the cmpxchg, just for peace of mind?Sounds reasonable to me at could simplify qemu_event_wait a bit.
Hmm, it does avoid a whole system call in the Windows case, so I prefer to keep it. And I prefer to keep the load-acquire on the fast path too, I don't think it's needed in the actual uses of QemuEvent but it's safer in case it's used as "just a boolean".
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |