Solved

Improve application speed with Dual Core

Posted on 2007-03-26
2
213 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

738 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