From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51132 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPWNa-0005mA-RT for qemu-devel@nongnu.org; Fri, 18 Jun 2010 03:52:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPWNY-0001nN-GE for qemu-devel@nongnu.org; Fri, 18 Jun 2010 03:52:45 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:52052) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPWNY-0001nH-CD for qemu-devel@nongnu.org; Fri, 18 Jun 2010 03:52:44 -0400 Received: by wyb36 with SMTP id 36so627166wyb.4 for ; Fri, 18 Jun 2010 00:52:43 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C1B25C4.9060804@redhat.com> Date: Fri, 18 Jun 2010 09:52:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20100616115404.10988.62371.stgit@localhost.localdomain> <20100616115656.10988.96529.stgit@localhost.localdomain> <4C18C4C8.8090901@redhat.com> <20100617085325.GA2849@in.ibm.com> <4C19F477.6080709@redhat.com> <4C1A63E8.1000802@linux.vnet.ibm.com> In-Reply-To: <4C1A63E8.1000802@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH V4 2/3] qemu: Generic task offloading framework: threadlets List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Avi Kivity , ego@in.ibm.com, Qemu-development List , Corentin Chary , "Aneesh Kumar K.V" On 06/17/2010 08:05 PM, Anthony Liguori wrote: > On 06/17/2010 05:09 AM, Paolo Bonzini wrote: >>>>> + while (QTAILQ_EMPTY(&(queue->request_list))&& >>>>> + (ret != ETIMEDOUT)) { >>>>> + ret = qemu_cond_timedwait(&(queue->cond), >>>>> + &(queue->lock), 10*100000); >>>>> + } >>>> >>>> Using qemu_cond_timedwait is a hack for not properly broadcasting the >>>> condvar in flush_threadlet_queue. >>> >>> I think Anthony answered this one. >> >> I think he said that the code has been changed so I am right? :) > > You're right about the condition we check in the exit path but the > timedwait is needed to expire an idle thread. In posix-aio-compat, yes. In threadlets you'll expire excess idle threads after each threadlet has completed. If you want to keep the threads above the min_threads-th ready for 10 seconds, that's fine; but it's not what the v4 code does. Paolo