From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVY7-0003dB-4f for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:20:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzVY6-0006TW-7n for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:20:55 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:35261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzVY6-0006TM-1j for qemu-devel@nongnu.org; Fri, 02 Sep 2011 11:20:54 -0400 Received: by yih10 with SMTP id 10so2508810yih.4 for ; Fri, 02 Sep 2011 08:20:53 -0700 (PDT) Message-ID: <4E60F453.1090703@codemonkey.ws> Date: Fri, 02 Sep 2011 10:20:51 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <20110901163545.71ba1515@doriath> <4E6032AB.8080804@codemonkey.ws> <4E60DC77.5020300@redhat.com> <4E60E813.9000302@codemonkey.ws> <4E60F3B2.6000904@redhat.com> In-Reply-To: <4E60F3B2.6000904@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] monitor: Protect outbuf from concurrent access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Marian Krcmarik , Alon Levy , qemu-devel , spice-devel , Luiz Capitulino On 09/02/2011 10:18 AM, Gerd Hoffmann wrote: > Hi, > >>> A patch like the attached (warning: untested) should do as quick&dirty >>> fix for stable. But IMO we really should fix spice instead. >> >> I agree. I'm not sure I like the idea of still calling QEMU code without >> holding the mutex (even the QObject code). > > I though just creating the objects isn't an issue, but if you disagree > we can just move up the lock to the head of the function. What I fear is that Spice will assume something is thread safe, but then someone will make a change that makes the subsystem non-reentrant. I'd rather that we have very clear rules about what's thread safe and not thread safe. If you want to audit the QObject subsystem, declare it thread safe, and document it as such, that would be okay. But it needs to be systematic, not ad-hoc. Regards, Anthony Liguori > >> Can you just use a bottom half to defer this work to the I/O thread? >> Bottom half scheduling has to be signal safe which means it will also be >> thread safe. > > Not that straight forward as I would have to pass arguments to the > bottom half. > > cheers, > Gerd > >