From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNkYf-0007MU-00 for qemu-devel@nongnu.org; Thu, 04 Apr 2013 09:50:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNkYZ-0003wi-66 for qemu-devel@nongnu.org; Thu, 04 Apr 2013 09:50:28 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:51383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNkYY-0003vt-LM for qemu-devel@nongnu.org; Thu, 04 Apr 2013 09:50:23 -0400 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Apr 2013 23:43:28 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id F2EAC2CE804D for ; Fri, 5 Apr 2013 00:49:59 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r34DnrnS7668036 for ; Fri, 5 Apr 2013 00:49:55 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r34Dnw3P027237 for ; Fri, 5 Apr 2013 00:49:58 +1100 From: Anthony Liguori In-Reply-To: <515D135B.4020003@redhat.com> References: <1364893452-10604-1-git-send-email-peter.crosthwaite@xilinx.com> <515ABCD1.2070008@redhat.com> <82877867.1048290.1364970927865.JavaMail.root@redhat.com> <515D135B.4020003@redhat.com> Date: Thu, 04 Apr 2013 08:49:51 -0500 Message-ID: <87vc82h0cg.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [RFC PATCH] main-loop: Unconditionally unlock iothread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Crosthwaite Cc: Amit Shah , Jan Kiszka , qemu-devel@nongnu.org, gson@gson.org Paolo Bonzini writes: > Il 04/04/2013 01:58, Peter Crosthwaite ha scritto: >> >> I think there may be a flaw in that "any of the descriptors being >> pollable" is not a good definition of progress. stdin is blocked by >> the fact that the device and mux cannot accept their data anymore so >> even though its readable, no meaningful read will happen. That leaves >> us with having to devise more elaborate code to define progress, or we >> simplify by just removing this nonblocking optimisation altogether >> (original patch). > > If stdin is blocked, it shouldn't be polled at all. That is the purpose > of the can_read callback. Unfortunately, return FALSE from the prepare > callback still leaves the poll handler. > > So your original patch fixes the symptom, but leaves the busy waiting > unfixed. > > The right thing to use would be g_source_add_child_source() and > g_source_remove_child_source(), but that is only present since glib 2.28 > and we currently require 2.12 (2.20 on Windows). > > Anthony, Amit, can you look at it? Ack. May not be until tomorrow but I'll try to dig in here. Regards, Anthony Liguori > > Paolo