[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable
From: |
Daniel P. Berrange |
Subject: |
Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable |
Date: |
Sun, 9 Mar 2008 16:23:43 +0000 |
User-agent: |
Mutt/1.4.1i |
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 :|
- [Qemu-devel] [PATCH] use a thread id variable, (continued)
- Re: [kvm-devel] [Qemu-devel] [PATCH] use a thread id variable,
Daniel P. Berrange <=
[Qemu-devel] Re: [PATCH 0/3] Expose thread id through info cpus, Glauber Costa, 2008/03/05
[Qemu-devel] Re: [PATCH 0/3] Expose thread id through info cpus, Avi Kivity, 2008/03/06