[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore |
Date: |
Tue, 24 Jul 2012 18:55:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
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 (cv->waiters), but it is accessed atomically. To do
> what you suggest I would need to add a mutex.
FWIW, I found a good condvar implementation in Chromium, but I really
don't have the time to port it over to QEMU right now. I still would
like to get the semaphore version in 1.2.
Also, the attached pseudo-patch is an example of using semaphores to
limit the size of the critical sections, and also decrease the number of
threads created. I'm not proposing to include it now, it's just an
example of things that are harder with condition variables than with
semaphores.
Paolo
thread-pool-sem.patch
Description: Text Data
- [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, (continued)
- [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Paolo Bonzini, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Jan Kiszka, 2012/07/16
- [Qemu-devel] [PATCH] qemu-thread: Introduce qemu_cond_timedwait for POSIX, Jan Kiszka, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Paolo Bonzini, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Jan Kiszka, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Paolo Bonzini, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Jan Kiszka, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Paolo Bonzini, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Jan Kiszka, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore, Paolo Bonzini, 2012/07/16
- Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore,
Paolo Bonzini <=
[Qemu-devel] [PATCH 08/12] aio: add generic thread-pool facility, Paolo Bonzini, 2012/07/16
[Qemu-devel] [PATCH 10/12] raw: merge posix-aio-compat.c into block/raw-posix.c, Paolo Bonzini, 2012/07/16
[Qemu-devel] [PATCH 11/12] raw-posix: rename raw-posix-aio.h, hide unavailable prototypes, Paolo Bonzini, 2012/07/16
[Qemu-devel] [PATCH 12/12] raw-win32: add emulated AIO support, Paolo Bonzini, 2012/07/16
[Qemu-devel] [PATCH 09/12] block: switch posix-aio-compat to threadpool, Paolo Bonzini, 2012/07/16