From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43385 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKWoR-0003JT-Dz for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:19:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKWoC-00089M-Hu for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:19:41 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]:47735) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKWoC-00089D-DY for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:19:36 -0400 Received: by fg-out-1718.google.com with SMTP id 16so614121fgg.10 for ; Fri, 04 Jun 2010 06:19:34 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4C08FAA3.5020502@codemonkey.ws> References: <20100603085223.25546.88499.stgit@localhost.localdomain> <20100603085618.25546.99966.stgit@localhost.localdomain> <4C07A093.8020907@redhat.com> <4C08FAA3.5020502@codemonkey.ws> Date: Fri, 4 Jun 2010 15:19:34 +0200 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH V3 1/3] qemu: Add qemu-wrappers for pthread_attr_t From: Corentin Chary Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , Avi Kivity , Qemu-development List , Gautham R Shenoy On Fri, Jun 4, 2010 at 3:07 PM, Anthony Liguori wro= te: > On 06/03/2010 07:31 AM, Paolo Bonzini wrote: >> >> On 06/03/2010 10:56 AM, Gautham R Shenoy wrote: >>> >>> Add qemu wrappers for pthread_attr_t handling. >> >> The point of these wrappers AFAIU is not only to add error_exit, but als= o >> to be portable to Windows in the future. =A0Is it necessary to create th= e >> threads as detached? =A0If you set queue->min_threads to zero all thread= s >> should exit as soon as they finish their work (which is better than exit= ing >> immediately). > > This is historical because the code was largely inspired by glibc's > implementation of posix-aio. =A0It 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. > > Regards, > > Anthony Liguori 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 :) ). --=20 Corentin Chary http://xf.iksaif.net