From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqlS4-0000pw-RP for qemu-devel@nongnu.org; Mon, 16 Jul 2012 09:35:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqlRv-0004CR-69 for qemu-devel@nongnu.org; Mon, 16 Jul 2012 09:35:04 -0400 Received: from david.siemens.de ([192.35.17.14]:21161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqlRu-0004Bv-SY for qemu-devel@nongnu.org; Mon, 16 Jul 2012 09:34:55 -0400 Message-ID: <50041869.20006@siemens.com> Date: Mon, 16 Jul 2012 15:34:33 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1342435377-25897-1-git-send-email-pbonzini@redhat.com> <1342435377-25897-8-git-send-email-pbonzini@redhat.com> <50040251.5000700@siemens.com> <50041510.5070105@redhat.com> In-Reply-To: <50041510.5070105@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/12] qemu-thread: add QemuSemaphore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "kwolf@redhat.com" , "aliguori@linux.vnet.ibm.com" , "sw@weilnetz.de" , "qemu-devel@nongnu.org" , "stefanha@linux.vnet.ibm.com" On 2012-07-16 15:20, Paolo Bonzini wrote: > Il 16/07/2012 14:00, Jan Kiszka ha scritto: >> On 2012-07-16 12:42, Paolo Bonzini wrote: >>> The new thread pool will use semaphores instead of condition >>> variables, because QemuCond does not have qemu_cond_timedwait. >> >> I'll post an updated patch (according to last round's review comments) >> that adds this service for POSIX. I bet you'll find a way to extend it >> to Win32 if that is required. ;) > > I can do that (or just use pthreads-win32), but only at the cost of > making cond_wait() slower and more complex. Why will it affect cond_wait? WaitForSingleObject can time out as well. > >>> (I also like it more this way, since semaphores model well the >>> producer-consumer problem). >> >> Let's not introduce another synchronization mechanism unless there is a >> real need. Semaphores tend to be misused for things they don't fit, so >> better keep them out of reach. > > That's what patch review is for... But even better is avoiding the temptation. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux