[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 02/10] main-loop: switch to g_poll() on POSIX
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 02/10] main-loop: switch to g_poll() on POSIX hosts |
Date: |
Mon, 04 Feb 2013 19:11:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 04/02/2013 18:51, Fabien Chouteau ha scritto:
> On 02/04/2013 06:35 PM, Paolo Bonzini wrote:
>> Il 04/02/2013 16:07, Stefan Hajnoczi ha scritto:
>>>>> No idea why the windows version has been mixing g_poll() and select().
>>>>> I'd hope that this series kills select() for uniformity's sake, but the
>>>>> 00/10 subject and the commit msg for this patch indicate otherwise.
>>> This is why I CCed Fabien. I left the g_poll-followed-by-select
>>> behavior. It may be to do with Windows treating sockets different from
>>> other objects. Paolo may know the answer, too.
>>
>> Windows uses g_poll for HANDLEs and select for sockets. All sockets are
>> configured to trigger an event handle when there is a change in the
>> socket availability, so g_poll exits and select is reexecuted.
>
> Yes, the reason for this select() call is that we know when an event
> occurred on one socket, but we don't know what kind of event and which
> socket.
>
> Would it be different if we had a HANDLE for each socket, instead of
> one for all?
Nope, I think you cannot assign different events for read and write.
Paolo
- Re: [Qemu-devel] [PATCH v3 01/10] main-loop: fix select_ret uninitialized variable warning, (continued)
[Qemu-devel] [PATCH v3 06/10] iohandler: switch to GPollFD, Stefan Hajnoczi, 2013/02/04
[Qemu-devel] [PATCH v3 05/10] slirp: switch to GPollFD, Stefan Hajnoczi, 2013/02/04
[Qemu-devel] [PATCH v3 04/10] slirp: slirp/slirp.c coding style cleanup, Stefan Hajnoczi, 2013/02/04
[Qemu-devel] [PATCH v3 07/10] main-loop: drop rfds/wfds/xfds for good, Stefan Hajnoczi, 2013/02/04
[Qemu-devel] [PATCH v3 08/10] aio: extract aio_dispatch() from aio_poll(), Stefan Hajnoczi, 2013/02/04