[Spice-devel] [PATCH v2 2/6] server: introduce dispatcher

Alon Levy alevy at redhat.com
Mon Nov 7 04:05:15 PST 2011


On Mon, Nov 07, 2011 at 12:52:25PM +0100, Paolo Bonzini wrote:
> On 11/07/2011 12:44 PM, Alon Levy wrote:
> >+void dispatcher_handle_recv_read(Dispatcher *dispatcher)
> >+{
> >+    while (dispatcher_handle_single_read(dispatcher)) {
> >+    }
> >+}
> 
> This will busy-wait if no messages are ready.

dispatcher_handle_single_read returns 0 when it fails to read a
message type, in the initial read_safe, which breaks the loop.

> 
> I'm not sure what you want to do here, since this is the sole caller
> of dispatcher_handle_single_read.
> 
> The POSIX bits look fine though, and that's the only part I really
> looked at.
> 

Right, out of laziness I cc-ed the whole bit to you and not just it.

Thanks,
Alon

> Paolo


More information about the Spice-devel mailing list