From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53516 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKWd2-00069b-MK for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:08:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKWcs-00056T-3r for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:07:58 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:53988) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKWcr-00054i-WF for qemu-devel@nongnu.org; Fri, 04 Jun 2010 09:07:54 -0400 Received: by iwn41 with SMTP id 41so1045368iwn.4 for ; Fri, 04 Jun 2010 06:07:52 -0700 (PDT) Message-ID: <4C08FAA3.5020502@codemonkey.ws> Date: Fri, 04 Jun 2010 08:07:47 -0500 From: Anthony Liguori 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> In-Reply-To: <4C07A093.8020907@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Avi Kivity , Qemu-development List , Corentin Chary , Gautham R Shenoy 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 > also to be portable to Windows in the future. Is it necessary to > create the threads as detached? If you set queue->min_threads to zero > all threads should exit as soon as they finish their work (which is > better than exiting immediately). 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. Regards, Anthony Liguori > Paolo >