From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37698 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8HtC-0006YM-Ga for qemu-devel@nongnu.org; Tue, 19 Oct 2010 15:30:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8HtB-000833-Jv for qemu-devel@nongnu.org; Tue, 19 Oct 2010 15:30:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8HtB-00082G-DW for qemu-devel@nongnu.org; Tue, 19 Oct 2010 15:30:25 -0400 Message-ID: <4CBDF1B7.3070908@redhat.com> Date: Tue, 19 Oct 2010 21:29:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 1/3] Introduce threadlets References: <20101019173946.16514.62027.stgit@localhost6.localdomain6> <20101019174245.16514.14542.stgit@localhost6.localdomain6> <20101019183644.GI15844@balbir.in.ibm.com> <4CBDEAEF.4080207@redhat.com> <20101019191225.GJ15844@balbir.in.ibm.com> In-Reply-To: <20101019191225.GJ15844@balbir.in.ibm.com> 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: balbir@linux.vnet.ibm.com Cc: Arun R Bharadwaj , qemu-devel@nongnu.org On 10/19/2010 09:12 PM, Balbir Singh wrote: > > >Ideally you need > > > > > > s = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); > > > > > > But qemu will need to wrap this around as well. > > > > Why? QEMU is never using thread cancellation. > > Yes, I agree, in the longer run, cancellation is a good way to kill > threads, specially in a thread pool. My comment was more along the > lines of good practices and potential use of pthread_cancel(), not a > strict comment on something urgent or broken. But there is no such use; as long as we keep ourselves to the qemu-thread API, we know that nothing will use cancellation. The day qemu-thread will introduce cancellation functions we'll care about enabling/disabling it in some threads. Paolo