Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-24 Thread Paolo Bonzini
Il 16/07/2012 16:20, Paolo Bonzini ha scritto: >> > ...and that's why you check what needs to be done to handle this race >> > after grabbing the mutex. IOW, replicate the state information that the >> > Windows semaphore contains into the emulated condition variable object. > It is already there (

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 16:09, Jan Kiszka ha scritto: > On 2012-07-16 16:03, Paolo Bonzini wrote: >> Il 16/07/2012 15:53, Jan Kiszka ha scritto: > > qemu_cond_wait only uses WaitForSingleObject with INFINITE timeout, and > the algorithm relies on that. >>> I see. But this doesn't look complex awf

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Jan Kiszka
On 2012-07-16 16:03, Paolo Bonzini wrote: > Il 16/07/2012 15:53, Jan Kiszka ha scritto: qemu_cond_wait only uses WaitForSingleObject with INFINITE timeout, and the algorithm relies on that. >> I see. But this doesn't look complex awfully. Just move the waker >> signaling from within

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 15:53, Jan Kiszka ha scritto: >> > >> > qemu_cond_wait only uses WaitForSingleObject with INFINITE timeout, and >> > the algorithm relies on that. > I see. But this doesn't look complex awfully. Just move the waker > signaling from within cond_wait under the mutex as well, maybe add

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Jan Kiszka
On 2012-07-16 15:35, Paolo Bonzini wrote: > Il 16/07/2012 15:34, Jan Kiszka ha scritto: >> On 2012-07-16 15:20, Paolo Bonzini wrote: >>> Il 16/07/2012 14:00, Jan Kiszka ha scritto: On 2012-07-16 12:42, Paolo Bonzini wrote: > The new thread pool will use semaphores instead of condition

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 15:34, Jan Kiszka ha scritto: > On 2012-07-16 15:20, Paolo Bonzini wrote: >> Il 16/07/2012 14:00, Jan Kiszka ha scritto: >>> On 2012-07-16 12:42, Paolo Bonzini wrote: The new thread pool will use semaphores instead of condition variables, because QemuCond does not have qemu_

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Jan Kiszka
On 2012-07-16 15:20, Paolo Bonzini wrote: > Il 16/07/2012 14:00, Jan Kiszka ha scritto: >> On 2012-07-16 12:42, Paolo Bonzini wrote: >>> The new thread pool will use semaphores instead of condition >>> variables, because QemuCond does not have qemu_cond_timedwait. >> >> I'll post an updated patch (

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 14:00, Jan Kiszka ha scritto: > On 2012-07-16 12:42, Paolo Bonzini wrote: >> The new thread pool will use semaphores instead of condition >> variables, because QemuCond does not have qemu_cond_timedwait. > > I'll post an updated patch (according to last round's review comments) > tha

Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Jan Kiszka
On 2012-07-16 12:42, Paolo Bonzini wrote: > The new thread pool will use semaphores instead of condition > variables, because QemuCond does not have qemu_cond_timedwait. I'll post an updated patch (according to last round's review comments) that adds this service for POSIX. I bet you'll find a way

[Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore

2012-07-16 Thread Paolo Bonzini
The new thread pool will use semaphores instead of condition variables, because QemuCond does not have qemu_cond_timedwait. (I also like it more this way, since semaphores model well the producer-consumer problem). Signed-off-by: Paolo Bonzini --- qemu-thread-posix.c | 74 +