From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0Tui-0007Mb-4W for qemu-devel@nongnu.org; Mon, 05 Sep 2011 03:48:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0Tud-0001Bf-Ol for qemu-devel@nongnu.org; Mon, 05 Sep 2011 03:48:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0Tud-0001AV-GQ for qemu-devel@nongnu.org; Mon, 05 Sep 2011 03:48:11 -0400 Message-ID: <4E647EB4.2050707@redhat.com> Date: Mon, 05 Sep 2011 09:48:04 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <20110901163545.71ba1515@doriath> <4E6032AB.8080804@codemonkey.ws> <4E60DC77.5020300@redhat.com> <4E60E813.9000302@codemonkey.ws> <4E60F3B2.6000904@redhat.com> <4E60F6BD.4090800@redhat.com> In-Reply-To: <4E60F6BD.4090800@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: Paolo Bonzini Cc: qemu-devel , Luiz Capitulino , Marian Krcmarik , Alon Levy , spice-devel On 09/02/11 17:31, Paolo Bonzini wrote: > On 09/02/2011 05:18 PM, Gerd Hoffmann wrote: >> >>> 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. > > Can you add a variant of qemu_bh_new that accepts a sizeof for the new > bottom half? Then the bottom half itself can be passed as the opaque and > used for the arguments. That wouldn't help. I would have to create some kind of job queue which is then processed by the bottom half. cheers, Gerd