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

2011-11-08 Thread Alon Levy
On Tue, Nov 08, 2011 at 09:31:27AM +0200, Yonit Halperin wrote: > Hi, > 2 comments bellow > On 11/07/2011 01:44 PM, Alon Levy wrote: > >used for main_dispatcher only in this patch. > > > >Dispatcher is meant to be used for Main<->any low frequency messages. > > > >It's interface is meant to include

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

2011-11-07 Thread Yonit Halperin
Hi, 2 comments bellow On 11/07/2011 01:44 PM, Alon Levy wrote: used for main_dispatcher only in this patch. Dispatcher is meant to be used for Main<->any low frequency messages. It's interface is meant to include the red_dispatcher usage: fixed size messages per message type some messages r

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

2011-11-07 Thread Paolo Bonzini
On 11/07/2011 01:05 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

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

2011-11-07 Thread Alon Levy
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.

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

2011-11-07 Thread Paolo Bonzini
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. I'm not sure what you want to do here, since this is the sole caller of dispat

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

2011-11-07 Thread Alon Levy
used for main_dispatcher only in this patch. Dispatcher is meant to be used for Main<->any low frequency messages. It's interface is meant to include the red_dispatcher usage: fixed size messages per message type some messages require an ack Some methods are added to be used by RedDispatcher l