From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52969 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxgNq-0001ei-PJ for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:58:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxgNo-0004Es-TR for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:58:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxgNo-0004Ej-I4 for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:58:28 -0500 Message-ID: <4D78D8FD.9070006@redhat.com> Date: Thu, 10 Mar 2011 14:58:21 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <4D7767C0.6060609@siemens.com> <1299761979-15197-2-git-send-email-corentin.chary@gmail.com> <4D78CCDF.6090906@redhat.com> <4D78D603.5060000@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/2] vnc: don't mess up with iohandlers in the vnc thread List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corentin Chary Cc: Anthony Liguori , kvm@vger.kernel.org, Jan Kiszka , qemu-devel , Anthony Liguori , Peter Lieven On 03/10/2011 02:54 PM, Corentin Chary wrote: > > > You can use a bottom half for this instead of a special socket. Signaling > > > a bottom half is async-signal- and thread-safe. > > > > Bottom halves are thread safe? > > > > I don't think so. > > The bottom halves API is not thread safe, but calling > qemu_bh_schedule_idle() Not _idle please. > in another thread *seems* to be safe (here, it > would be protected from qemu_bh_delete() by vnc_lock_output()). If it weren't protected against qemu_bh_delete, you would have already the same race between writing to the socket and closing it in another thread. Paolo