[Spice-devel] [PATCH spice-gtk 01/10] spice-channel: Allow spice_msg_out_send to be called from multiple threads

Christophe Fergeau cfergeau at redhat.com
Mon Jan 2 04:21:51 PST 2012


On Sat, Dec 24, 2011 at 09:23:15AM +0100, Hans de Goede wrote:
> Hi,
> 
> First of all thanks for the review of this series!
> 
> On 12/23/2011 06:10 PM, Christophe Fergeau wrote:
> >Hi,
> >
> >On Mon, Dec 19, 2011 at 12:24:34PM +0100, Hans de Goede wrote:
> >>This is a preparation patch for handling usb packet completion in a
> >>separate thread.
> >
> >I haven't looked at the patches extending this, but I have 2 comments
> >already:
> >* the xmit_queue_lock + xmit_queue combination looks a lot like GAsyncQueue
> 
> You may be right there, but I also need a lock to protect the variable
> which protects the queue from new messages been queued by the usb event handling
> thread after disconnect (and the queue has been cleared). Right now I can
> use the same lock for this, so sticking with the current code seems best.

Your call, there are g_async_queue_lock/_unlock functions so the
xmit_queue_blocked check could be protected with that.

> IOW the only interaction between the thread and the rest of spice-gtk
> is the queuing of SpiceMsgOut messages, which is relatively simple and as
> such should be quite safe.

Yeah, I know the 2 things are quite separated, but now someone hacking on
this code has to remember that sometimes we can be in a different thread,
in some other parts of the code in a coroutine context.
> 
> >Apart from this, the patch looks good.
> 
> Can I consider that an ack?

Yup

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120102/bfcc675b/attachment.pgp>


More information about the Spice-devel mailing list