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


Reply via email to