473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MultiThreading and Dual Core

Hi,
In a multi-threaded app on a dual core machine, is it possible to
know on which cpu a particular thread is currently executing on?

thanks,

Arun

Nov 7 '07 #1
3 2002
You can PInvoke some Win32 functions to get that information; but why would
you want to?

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"ar******@gmail.com" wrote:
Hi,
In a multi-threaded app on a dual core machine, is it possible to
know on which cpu a particular thread is currently executing on?

thanks,

Arun

Nov 7 '07 #2

<ar******@gmail.comwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
Hi,
In a multi-threaded app on a dual core machine, is it possible to
know on which cpu a particular thread is currently executing on?
No, because it can change at any time, including during the call to the
function that would find out.
>
thanks,

Arun

Nov 7 '07 #3
On Nov 7, 7:20 pm, Peter Ritchie [C# MVP] <PRS...@newsgroups.nospam>
wrote:
You can PInvoke some Win32 functions to get that information; but why would
you want to?

--
Browsehttp://connect.microsoft.com/VisualStudio/feedback/and vote.http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#

"aruna...@gmail.com" wrote:
Hi,
In a multi-threaded app on adualcoremachine, is it possible to
know on which cpu a particular thread is currently executing on?
thanks,
Arun- Hide quoted text -

- Show quoted text -
I am comparing the performance of my code ( multi threaded, cpu
intensive) in a single core and dual-core systems and only see a
performance gain of around 15%. This led me to wonder if the runtime
was actually using the dual core. Hence I was wondering if there was
any way I could find this out.

Alternatively, is there any way to get the usage statistics of both
the cores within my program?

thanks,

Arun

Nov 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: cwahlmeier | last post by:
Greetings, I am running DB2 Workgroup Edition on an Intel box with two physical CPUs. It is running Windows with hyperthreading. Thus, the operating system thinks it has 4 cpus. I am about to...
2
by: webwarrior | last post by:
Hi, Is there a reason why we have to pay more for licensing for a different kind of processor? Why are we not charged for the Hyperthreading on some processors also. If Oracle is really...
2
by: bruce_brodinsky | last post by:
Don't know whether to post this on a hardware or software board, so here goes: I wrote a c# chess program which searches for checkmate. Now, it's single-threaded. But I was thinking. I just got...
13
by: Pieter | last post by:
Hi, Maybe a little bit off-topic, but it still seemd the best place to ask for it :-) I'm planning to buy a new development laptop, and I would like to buy an AMD, Dual Core,-bit But none of...
1
by: P | last post by:
Hi, I'm working on server application. It use 8 ~ 16 multithread. The problem is when I put a breakpoint and when Visual Studio 2005 stop at that, sometimes IDE got stuck and cant' repaint...
4
by: LLessieux | last post by:
Hi, I have been seeing a strange behaviour when doing some tests on a Dual - Dual Core Opteron system using Windows XP (32bits with SP2). In out application we have a wrapper around the thread...
8
by: Andy | last post by:
Hi guys, I'm sorry, I'm not sure this is the correct group to be asking this kind of question... I'm going to develop a software package that includes a web server (and PHP code) , a...
3
by: Paul Sijben | last post by:
I am running a multi-threaded python application in a dual core intel running Ubuntu. I am using python 2.5.1 that I compiled myself. At random points I am getting segmentation faults (sometimes...
9
by: kumarchi | last post by:
hello: I wrote a simple program which does simple math loop and I am testing under dual core processor systm1: intel dual core laptop ; windows xp os when I spawn of two threads in windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.