Solved

Improve application speed with Dual Core

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

910 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

16 Experts available now in Live!

Get 1:1 Help Now