Click here to Skip to main content
15,893,622 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSQL in CHTMLView Pin
Frank Deo4-Feb-04 14:21
Frank Deo4-Feb-04 14:21 
Generalconnecting through ISA server Pin
anonymous1984-Feb-04 12:24
anonymous1984-Feb-04 12:24 
GeneralA silly question about CFile Pin
bin89224-Feb-04 12:23
bin89224-Feb-04 12:23 
GeneralRe: A silly question about CFile Pin
Antti Keskinen4-Feb-04 12:56
Antti Keskinen4-Feb-04 12:56 
GeneralRe: A silly question about CFile Pin
Abin4-Feb-04 18:37
Abin4-Feb-04 18:37 
GeneralThanks a lot. Pin
bin89224-Feb-04 19:17
bin89224-Feb-04 19:17 
GeneralRecursion... Pin
xzigax4-Feb-04 11:57
xzigax4-Feb-04 11:57 
GeneralRe: Recursion... Pin
Antti Keskinen4-Feb-04 13:08
Antti Keskinen4-Feb-04 13:08 
Let us approach the problem from a completely abstract level..

Firstly, your problem description does not specify the environment of the CPUs. If they are capable of multithreading, there should be some reference value of how many jobs one processor can simultaneously execute. But, as none is given (?), we will assume that each processor handles a single job first before accepting a new one.

This assumption will quickly lead us into mathematical equations: considering that the execution time of a random job is X seconds and is independent of the selected processor (equal speeds), then the equation would form up to something like "time = (M/N)*X".

As for the actual programming problem, recursion is a very effective way in solving equations that have an exponential form, such as 2^4. It would be a recursive function that multiplies 2 by 2 and gets executed 3 times. Your job here would then be to find the minimum of variable 'time' from the above equation. Needless to say, probably, that if X is equal on each job, the optimized result is when M = N.

Unfortunately I have no prepared example code for this purpose. The best way is to dig up some pen and paper, then attempt to create an exponential expression for 'time'. This expression can then be easily formatted into a recursive function.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralMoving objects on a form... Pin
Anonymous4-Feb-04 11:48
Anonymous4-Feb-04 11:48 
GeneralCan't receive WM_DRAWITEM message. Pin
Cael4-Feb-04 11:25
Cael4-Feb-04 11:25 
GeneralRe: Can't receive WM_DRAWITEM message. Pin
basementman4-Feb-04 11:34
basementman4-Feb-04 11:34 
GeneralRe: Can't receive WM_DRAWITEM message. Pin
Cael4-Feb-04 12:51
Cael4-Feb-04 12:51 
GeneralRe: Can't receive WM_DRAWITEM message. Pin
Roger Allen4-Feb-04 23:32
Roger Allen4-Feb-04 23:32 
GeneralRe: Can't receive WM_DRAWITEM message. Pin
Cael5-Feb-04 3:45
Cael5-Feb-04 3:45 
GeneralPrint .Net Bitmap With MFC Pin
Shaun Becker4-Feb-04 10:53
Shaun Becker4-Feb-04 10:53 
GeneralChanging Control Color Pin
monrobot134-Feb-04 10:30
monrobot134-Feb-04 10:30 
QuestionHow to put a CString variable in the IDR_MAINFRAME string? Pin
Davex_4-Feb-04 9:57
Davex_4-Feb-04 9:57 
GeneralUpdating Software (automatically) Pin
DanYELL4-Feb-04 9:54
DanYELL4-Feb-04 9:54 
Generalthe daily "WTF, my app. crashes" post ... Pin
Maximilien4-Feb-04 9:25
Maximilien4-Feb-04 9:25 
GeneralRe: the daily "WTF, my app. crashes" post ... Pin
Neville Franks4-Feb-04 10:04
Neville Franks4-Feb-04 10:04 
GeneralRe: the daily "WTF, my app. crashes" post ... Pin
Maximilien4-Feb-04 10:11
Maximilien4-Feb-04 10:11 
GeneralRe: the daily "WTF, my app. crashes" post ... Pin
Neville Franks4-Feb-04 10:16
Neville Franks4-Feb-04 10:16 
Generalautomatic setting a text in a text box using an API function("SetWindowText function isn't valid") Pin
Amr Abdel-Mohsen4-Feb-04 9:11
Amr Abdel-Mohsen4-Feb-04 9:11 
GeneralRe: automatic setting a text in a text box using an API function("SetWindowText function isn't valid") Pin
Nick Parker4-Feb-04 9:57
protectorNick Parker4-Feb-04 9:57 
GeneralRe: automatic setting a text in a text box using an API function("SetWindowText function isn't valid") Pin
Diddy4-Feb-04 23:22
Diddy4-Feb-04 23:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.