Solved

Improve application speed with Dual Core

Posted on 2007-03-26
2
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

623 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