From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYOJu-0002Tg-S5 for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:24:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYOJu-0002TO-6i for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:24:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYOJu-0002TL-4T for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:24:18 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYOJu-0008Mf-0f for qemu-devel@nongnu.org; Sun, 09 Mar 2008 12:24:18 -0400 Date: Sun, 9 Mar 2008 16:23:43 +0000 From: "Daniel P. Berrange" Subject: Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable Message-ID: <20080309162343.GA12460@redhat.com> References: <12047472711034-git-send-email-gcosta@redhat.com> <12047472772114-git-send-email-gcosta@redhat.com> <47D3AD53.6030809@codefidence.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47D3AD53.6030809@codefidence.com> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilad Ben-Yossef Cc: kvm-devel@lists.sourceforge.net, chrisw@sous-sol.org, qemu-devel@nongnu.org, Glauber Costa On Sun, Mar 09, 2008 at 11:26:43AM +0200, Gilad Ben-Yossef wrote: > Glauber Costa wrote: > > This patch introduces a "thread_id" variable to CPUState. > > It's duty will be to hold the process, or more generally, thread > > id of the current executing cpu > > > > env->nb_watchpoints = 0; > > +#ifdef __WIN32 > > + env->thread_id = GetCurrentProcessId(); > > +#else > > + env->thread_id = getpid(); > > +#endif > > *penv = env; > > > hmm... maybe I'm missing something, but in Linux at least I think you > would prefer this to be gettid() rather then getpid as each CPU has it's > own thread, not a different process. No, this patch is the generic QEMU code, which is single threaded, so using getpid() is correct. Glauber has a separate patch in this series which implements the equivalent for KVM which does indeed use gettid() Regards, Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|