[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] eventfd: making it rhread safe
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-devel] [PATCH] eventfd: making it rhread safe |
Date: |
Wed, 18 Jul 2012 18:25:02 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 |
Ping again?
On 09/07/12 13:10, Alexey Kardashevskiy wrote:
> Ping?
>
> On 02/07/12 05:48, Alexey Kardashevskiy wrote:
>> QEMU uses IO handlers to run select() in the main loop. The handlers list is
>> managed by qemu_set_fd_handler() helper which works fine when called from
>> the main thread as it is called not when select() is waiting.
>>
>> However sometime we need to update the handlers list from another thread.
>> For that the main loop's select() needs to be restarted with the updated
>> list.
>>
>> The patch adds the qemu_notify_event() call to interrupt select() and make
>> wrapping code to restart select() with the updated IO handlers list.
>>
>> Signed-off-by: Alexey Kardashevskiy <address@hidden>
>> Reviewed-by: Paolo Bonzini <address@hidden>
>>
>> ---
>> iohandler.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/iohandler.c b/iohandler.c
>> index 3c74de6..dea4355 100644
>> --- a/iohandler.c
>> +++ b/iohandler.c
>> @@ -77,6 +77,7 @@ int qemu_set_fd_handler2(int fd,
>> ioh->fd_write = fd_write;
>> ioh->opaque = opaque;
>> ioh->deleted = 0;
>> + qemu_notify_event();
>> }
>> return 0;
>> }
>>
>
>
--
Alexey
- Re: [Qemu-devel] QEMU question: is eventfd not thread safe?, (continued)
- Re: [Qemu-devel] QEMU question: is eventfd not thread safe?, Paolo Bonzini, 2012/07/01
- Re: [Qemu-devel] QEMU question: is eventfd not thread safe?, Alexey Kardashevskiy, 2012/07/01
- Re: [Qemu-devel] [PATCH] eventfd: making it rhread safe, Michael S. Tsirkin, 2012/07/18
- [Qemu-devel] [PATCH] eventfd: making it thread safe, Alexey Kardashevskiy, 2012/07/18
- Re: [Qemu-devel] [PATCH] eventfd: making it thread safe, Michael S. Tsirkin, 2012/07/18
- Re: [Qemu-devel] [PATCH] eventfd: making it thread safe, Alexey Kardashevskiy, 2012/07/18
- [Qemu-devel] [PATCH] eventfd: making it thread safe, Alexey Kardashevskiy, 2012/07/18