Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Improve application speed with Dual Core

Posted on 2007-03-26
2
Medium Priority
?
215 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 1000 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
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.

704 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