From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T66xG-0005fr-0n for qemu-devel@nongnu.org; Mon, 27 Aug 2012 17:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T66xE-0005SV-UW for qemu-devel@nongnu.org; Mon, 27 Aug 2012 17:34:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T66xE-0005SC-FP for qemu-devel@nongnu.org; Mon, 27 Aug 2012 17:34:40 -0400 Message-ID: <503BE7E8.2000109@redhat.com> Date: Mon, 27 Aug 2012 23:34:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1345801763-24227-1-git-send-email-qemulist@gmail.com> <1345801763-24227-11-git-send-email-qemulist@gmail.com> <874nnoh3pg.fsf@codemonkey.ws> <503B8C1E.6090800@siemens.com> <87pq6cfjtm.fsf@codemonkey.ws> <503B91A9.7010507@siemens.com> <87k3wkjobd.fsf@codemonkey.ws> <503BBDFC.8070806@redhat.com> <87d32cxhy4.fsf@codemonkey.ws> <503BDF85.80802@redhat.com> In-Reply-To: <503BDF85.80802@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Jan Kiszka , Liu Ping Fan , Liu Ping Fan , Anthony Liguori , "qemu-devel@nongnu.org" Il 27/08/2012 22:58, Avi Kivity ha scritto: >> > It's best to start this conversion using very coarse locking. There's >> > no need to start with ultra fine grain locking. > How does it work? You have to drop this main loop lock to dispatch the > callback, so the data structure you use for dispatch is no longer protected. It is protected by a mixture of reference counting, thread-local storage and careful coding to take care of re-entrancy. I'm not too sure that we can use it, though. Mostly because of the reasons Jan mentioned (it may also not be precise enough, but we can fix that with our own GSource wrapping POSIX real-time timers or Linux timerfds). Paolo