Hi <div><br></div><div>Here is my experiment:</div><div>I created a new port-channel to transfer data between vdagent and spice-gtk. I used a while loop to send 2kb data to gtk, gtk received and drop the data. In the mean time I used a timer(1ms) to send 2kb data to vdagent. </div><div>Strange thing is that gtk will continually receive data for a while(10secs - 70secs) then send a whole bunch of data to vdagent. When receiving data, send data will be added to tcp buffer but will not be sent out.</div><div><br></div><div>So I think send event will be affected by receive event, then I guess using different thread would help. </div><div>Could you please correct me if I¡¯m wrong?</div><div><br></div><div>BR</div><div>Don<br><br><br><br><br><div id="spnEditorSign_app"><br></div><br><br><br>ÔÚ 2020-06-12 20:03:30£¬"Marc-Andr¨¦ Lureau" <marcandre.lureau@gmail.com> Ð´µÀ£º<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div dir="ltr"><div dir="ltr">Hi<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 12, 2020 at 12:57 PM ³ÂžÝ <<a href="mailto:qishiyexu2@126.com">qishiyexu2@126.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div style="margin:0px">Hi,</div><div style="margin:0px"><br></div><div style="margin:0px">Spice-gtk is now using co-routine to handle different channel connections. When a channel is handling data, other channels would have to wait, rather than handling synchronously.  That would bring us following issues:</div><div style="margin:0px"> 1. If some less important channels (like usb channels) are transfering big data, important channels (main-channel, display-channel,input-channel) will be affected.  </div><div style="margin:0px"> 2. When receiving big data like file transfering(G_IO_IN), send event (G_IO_OUT) will not be triggered.</div><div style="margin:0px"> 3. Flow control between different channels will be hard to do. </div><div style="margin:0px"><br></div><div style="margin:0px">Is is possible(and make sense) to put channels into different threads so they can synchronously receive & send msg, without affect each other?</div><div style="margin:0px"><br></div></div></blockquote><div><br></div><div>Switching to threads would be possible, but that wouldn't help in the situation you describe, as you are very likely bound on IO. Using several threads would actually create more problems to synchronize and schedule the different channels.</div><div><br></div><div>Io operations in coroutines are non-blocking, so they shouldn't affect other spice-gtk task. If you however observe a blocking CPU-task in some channel, this may affect the performance of other channels. But in general, except for video/image decoding which may be done in a separate thread, the client side doesn't do much work.</div><div><br></div><div>USB, clipboard and file sharing may use large amounts of data, and we rely on the glib source and kernel to prioritize channels: this isn't great in some cases and may receive improvements.<br></div><div><br></div></div><br>-- <br><div dir="ltr" class="gmail_signature">Marc-Andr¨¦ Lureau<br></div></div>
</blockquote></div><br><br><span title="neteasefooter"><p> </p></span>