qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_ad


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_add_watch
Date: Fri, 25 Nov 2011 10:48:12 -0500 (EST)

> > > >  slirp is fd_set---thus select()---based.  iohandler too,
> > > >  though it would likely be simpler to switch it to poll().
> > > Right, for slirp and iohandler, but it seems wrong to take file
> > > descriptors from g_main_context_query() and put them in the
> > > fd_sets for
> >> select(). This part is still in the code today.
> > 
> > It's ugly, but it works.
> 
> For Windows I'm not sure it will work.

No, it doesn't (see my other message).

> > There's a fundamental impedence mismatch between glib and
> > slirp/iohandler.  Either you convert glib's pollfds to fd_sets, or
> > you
> > take slirp and iohandler's fd_sets and put them in pollfds.
> > Converting slirp and iohandler to produce pollfds is not easy
> > because
> > Windows does not have poll---so you'd still have a pollfd-to-fd_set
> > conversion somewhere.
> 
> Is it possible to use both? Keep the select scheme for iohandlers and
> slirp, but use g_main_context_iteration() for Glib stuff.

Perhaps with two threads, but I think it's more complicated than
merging the handle/fd sets and doing a single poll.

For Windows you already have three/four separate polls and
unifying some of them would improve responsiveness.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]