[Spice-devel] [PATCH spice-server v2 1/6] red-channel-client: Remove push call where not necessary
Christophe Fergeau
cfergeau at redhat.com
Wed Sep 6 09:39:51 UTC 2017
On Mon, Sep 04, 2017 at 11:28:45AM -0400, Frediano Ziglio wrote:
> >
> > On Mon, Sep 04, 2017 at 10:50:44AM -0400, Frediano Ziglio wrote:
> > > >
> > > > On Mon, Sep 04, 2017 at 12:02:05PM +0100, Frediano Ziglio wrote:
> > > > > Now the push is done automatically when a PipeItem is added
> > > > > (cfr commit 5c460de1a3972b7cf2b9b2944d0b500c3affc363
> > > > > "worker: push data when clients can receive them"),
> > > > > forcing a push cause only network fragmentation and is required
> > > > > only if you are handling data in a loop instead of using the
> > > > > default loop.
> > > >
> > > > in a loop instead of using the default loop? Are you talking about
> > >
> > > yes, confusing. In some ugly point of code there are some polling loop.
> > > Basically instead of using events we try to send data, wait for a bit then
> > > try to receive and so on. So
> > >
> > > forcing a push cause only network fragmentation and is required
> > > only if you are handling data in a polling loop instead of using the
> > > default event loop.
> > >
> > > sounds better ?
> >
> > Hmm, is that "instead"? Or is it that the polling loop is blocking the
> > default event loop/the main loop?
> >
>
> Yes, entirely avoiding the event loop. Really, the code is
>
> while (condition || timeout) {
> send()
> sleep() // really! no poll/select whatever
> receive()
> }
>
> I means is safe as you can't have recursive event loop call
> but I don't like poll code that much.
I would word the log as
"is required only if you are handling data in a polling loop (and thus,
you are preventing the default event loop from running)" if that makes
sense here.
Christophe
More information about the Spice-devel
mailing list