cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
Making visual cpp program use dual core?
Making visual cpp program use dual core?
Feb 1, 2009 at 1:32am UTC
helloworld922
(12)
How do you make a visual cpp project run using duel cores? I looked at the affinity in the control panel, and it is set to use both cores, but the cpu meter only shows one core maxing out when I run a cpu-intensive section (calculating primes).
Feb 1, 2009 at 4:47pm UTC
corbin
(3)
I could have no idea what I'm talking about, but I think 1 thread can only execute on one core at a time.
Feb 1, 2009 at 8:38pm UTC
helloworld922
(12)
Yeah, sorry... after a bit of research, what I meant was how do you create a multi-threaded application?
Feb 2, 2009 at 5:05am UTC
helios
(17575)
HANDLE WINAPI CreateThread(
__in LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress,
__in LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out LPDWORD lpThreadId
);
Since you're using VC++, you might want to consider using OpenMP directives.
Here's a nice article on the subject:
http://msdn.microsoft.com/en-us/magazine/cc163717.aspx
Topic archived. No new replies allowed.