Solved

Improve application speed with Dual Core

Posted on 2007-03-26
2
208 Views
Last Modified: 2010-08-05
I develop a MFC application with Visual Studio 6.0.  If is a very intensive program (lots of calculations) and uses onidle() to grab any spare system resources and run an analysis.  This is fine, except that running other programs is sluggish.

We have been told that with a dual core machine, we could add "a line of code" which would mean our application could run in the background nicely while the user gets on with other stuff and less interference.  

Is this correct, and if so, any tips on the one line of code that will help us?!

Thanks

Richard
0
Comment
Question by:richardpeters
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18794449
Usually, if you have a dual core machine, you don't have to add anything, since the OS will transparently schedule you application and the others to load balance both cores. If you have a multithreaded app, you can use 'SetThreadIdealProcessor()' to set a worker thread to run on a certain core to improve the responsiveness of the system.
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 250 total points
ID: 18794754
Indeed,a dual-core-cpu is a double-processor and was balanced automatically by the operation system. Any interferences from you may work contra that kind of optimization. The OnIdle doesn't run in a separate thread but simply was invoked when the message queue was empty. So, it runs in the same thread as the application and was processed by one core only while the other could handle all other applications.

Regards, Alex
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 129
C++ get user from AD  (VS6) 7 48
FMX StringGrid1->Canvas->FillRect Problem 3 100
Socket Programming (Unix) 8 102
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now