From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41227 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKWvy-0006mi-4l for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKWvt-0002Sh-In for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:27:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36477) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKWvt-0002SY-C4 for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:27:33 -0400 Message-ID: <4C08FF3C.20002@redhat.com> Date: Fri, 04 Jun 2010 15:27:24 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH V3 1/3] qemu: Add qemu-wrappers for pthread_attr_t References: <20100603085223.25546.88499.stgit@localhost.localdomain> <20100603085618.25546.99966.stgit@localhost.localdomain> <4C07A093.8020907@redhat.com> <4C08FAA3.5020502@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corentin Chary Cc: Avi Kivity , Qemu-development List , Gautham R Shenoy On 06/04/2010 03:19 PM, Corentin Chary wrote: >>> The point of these wrappers AFAIU is not only to add error_exit, but also >>> to be portable to Windows in the future. >> >> This is historical because the code was largely inspired by glibc's >> implementation of posix-aio. It doesn't need to be detached and since >> Corentin wants to be able to join a worker, it makes sense to just avoid >> detaching and pay the overhead of making the threads joinable. > > Actually, I want to know if the queue is empty and if no job are > currently being processed: all worker are idle or stopped. I don't > really need pthread_join() for that, since worker can be idle (we > don't want to always start and stop the thread :) ). Then it's also fine to have all qemu_threads detached (like in my patch to create all qemu_threads with blocked signals). I just want to avoid implementing pthreads one day for qemu-threads-win32.c. Paolo