All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gilad Ben-Yossef <gilad@codefidence.com>
Cc: kvm-devel@lists.sourceforge.net, chrisw@sous-sol.org,
	qemu-devel@nongnu.org, Glauber Costa <gcosta@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] use a thread id variable
Date: Sun, 9 Mar 2008 16:23:43 +0000	[thread overview]
Message-ID: <20080309162343.GA12460@redhat.com> (raw)
In-Reply-To: <47D3AD53.6030809@codefidence.com>

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 :|

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

WARNING: multiple messages have this Message-ID (diff)
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gilad Ben-Yossef <gilad@codefidence.com>
Cc: kvm-devel@lists.sourceforge.net, chrisw@sous-sol.org,
	qemu-devel@nongnu.org, Glauber Costa <gcosta@redhat.com>
Subject: Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable
Date: Sun, 9 Mar 2008 16:23:43 +0000	[thread overview]
Message-ID: <20080309162343.GA12460@redhat.com> (raw)
In-Reply-To: <47D3AD53.6030809@codefidence.com>

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 :|

  parent reply	other threads:[~2008-03-09 16:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 20:01 [PATCH 0/3] Expose thread id through info cpus Glauber Costa
2008-03-05 20:01 ` [Qemu-devel] " Glauber Costa
2008-03-05 20:01 ` [PATCH] use a thread id variable Glauber Costa
2008-03-05 20:01   ` [Qemu-devel] " Glauber Costa
2008-03-05 20:01   ` [PATCH] augment info cpus Glauber Costa
2008-03-05 20:01     ` [Qemu-devel] " Glauber Costa
2008-03-05 20:01     ` [PATCH] KVM: use actual thread id for vcpus Glauber Costa
2008-03-05 20:01       ` [Qemu-devel] " Glauber Costa
2008-03-09  9:26   ` [Qemu-devel] [PATCH] use a thread id variable Gilad Ben-Yossef
2008-03-09  9:26     ` Gilad Ben-Yossef
2008-03-09 11:58     ` Jamie Lokier
2008-03-09 11:58       ` Jamie Lokier
2008-03-09 14:52       ` Gilad Ben-Yossef
2008-03-09 14:52         ` Gilad Ben-Yossef
2008-03-09 16:12         ` M. Warner Losh
2008-03-09 16:12           ` M. Warner Losh
2008-03-17 17:55         ` Glauber Costa
2008-03-17 17:55           ` Glauber Costa
2008-03-09 16:09       ` M. Warner Losh
2008-03-09 16:09         ` M. Warner Losh
2008-03-09 20:01         ` Jamie Lokier
2008-03-09 20:01           ` Jamie Lokier
2008-03-09 16:23     ` Daniel P. Berrange [this message]
2008-03-09 16:23       ` [kvm-devel] " Daniel P. Berrange
2008-03-05 20:07 ` [PATCH 0/3] Expose thread id through info cpus Glauber Costa
2008-03-05 20:07   ` [Qemu-devel] " Glauber Costa
2008-03-06  6:55 ` Avi Kivity
2008-03-06  6:55   ` [Qemu-devel] " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080309162343.GA12460@redhat.com \
    --to=berrange@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=gcosta@redhat.com \
    --cc=gilad@codefidence.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.