From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFTsV-00061a-SN for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:20:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFTsL-0000HA-QS for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:20:12 -0400 Received: from goliath.siemens.de ([192.35.17.28]:32140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFTsL-0000AX-FA for qemu-devel@nongnu.org; Wed, 04 Apr 2012 13:20:05 -0400 Message-ID: <4F7C82B8.8090602@siemens.com> Date: Wed, 04 Apr 2012 19:19:52 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4F7C663E.20200@redhat.com> <4F7C67BA.4000007@siemens.com> <4F7C68E2.508@redhat.com> <4F7C715E.506@siemens.com> <4F7C7928.1070404@redhat.com> <4F7C7D11.3040302@siemens.com> In-Reply-To: <4F7C7D11.3040302@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/5] Spread the use of QEMU threading & locking API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , "qemu-devel@nongnu.org" On 2012-04-04 18:55, Jan Kiszka wrote: > On 2012-04-04 18:39, Paolo Bonzini wrote: >> Il 04/04/2012 18:05, Jan Kiszka ha scritto: >>>>> Perhaps you can take the relevant patches out of the thread-blocks >>>>> branch at git://github.com/pbonzini/qemu.git? The iothread eventfd >>>>> could also use an EventNotifier. >>> Yep, this screams for something like QemuEvent which pleases all users >>> of current qemu_eventfd and EventNotifier - and fit into the existing >>> threading/synchronization abstraction layout. >> >> Kind of, on Unix you cannot poll synchronization primitives so Ah, you meant on Win32 you cannot poll! >> EventNotifier has to remain separate from qemu-thread. > > QemuEvent will be pollable as you can ask it for its read fd: > > void qemu_event_init(QemuEvent *event, bool signaled); > void qemu_event_destroy(QemuEvent *event); > int qemu_event_get_write_fd(QemuEvent *event); > int qemu_event_get_read_fd(QemuEvent *event); > void qemu_event_signal(QemuEvent *event); > bool qemu_event_check(QemuEvent *event); > > I'm not yet convinced a qemu_event_set_handler buys us a lot, so I > prefer the get_read_fd interface for now. I'm starting to understand your abstraction here - makes sense. :) Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux