Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Execute two classe Pin
Rajesh R Subramanian15-Jan-10 1:08
professionalRajesh R Subramanian15-Jan-10 1:08 
AnswerRe: Execute two classes Pin
CPallini15-Jan-10 0:19
mveCPallini15-Jan-10 0:19 
AnswerRe: Execute two classes Pin
Mattias G15-Jan-10 1:34
Mattias G15-Jan-10 1:34 
GeneralRe: Execute two classes Pin
Cedric Moonen15-Jan-10 2:23
Cedric Moonen15-Jan-10 2:23 
GeneralRe: Execute two classes Pin
Mattias G15-Jan-10 3:44
Mattias G15-Jan-10 3:44 
GeneralRe: Execute two classes Pin
Cedric Moonen15-Jan-10 4:07
Cedric Moonen15-Jan-10 4:07 
GeneralRe: Execute two classes Pin
Rajesh R Subramanian15-Jan-10 5:18
professionalRajesh R Subramanian15-Jan-10 5:18 
GeneralRe: Execute two classes Pin
CPallini15-Jan-10 5:42
mveCPallini15-Jan-10 5:42 
Have a look at Idle Loop Processing, namely:
Many applications perform lengthy processing "in the background." Sometimes performance considerations dictate using multithreading for such work. Threads involve extra development overhead, so they are not recommended for simple tasks like the idle-time work that MFC does in the OnIdle function. This article focuses on idle processing. For more information about multithreading, see Multithreading Topics.

Some kinds of background processing are appropriately done during intervals that the user is not otherwise interacting with the application. In an application developed for the Microsoft Windows operating system, an application can perform idle-time processing by splitting a lengthy process into many small fragments. After processing each fragment, the application yields execution control to Windows using a PeekMessage loop.

Aside of performance considerations, I've underlined the key concept behind idle time processing: you need to fragment a lenghty operation. That means you've to build a state machine. Of course it is a viable approach but using a separate thread means that, conceptually, the execution flow is never broken.
Multithreading requires care, I admit, but you cannot deduce by your bad experience with, that multithreading is bad.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Execute two classes Pin
Mattias G19-Jan-10 3:23
Mattias G19-Jan-10 3:23 
GeneralRe: Execute two classes Pin
CPallini19-Jan-10 3:29
mveCPallini19-Jan-10 3:29 
GeneralRe: Execute two classes Pin
CPallini15-Jan-10 2:44
mveCPallini15-Jan-10 2:44 
QuestionWorking with POP3 from Win32 application Pin
VictorSotnikov14-Jan-10 22:05
VictorSotnikov14-Jan-10 22:05 
AnswerRe: Working with POP3 from Win32 application Pin
«_Superman_»14-Jan-10 22:15
professional«_Superman_»14-Jan-10 22:15 
GeneralRe: Working with POP3 from Win32 application Pin
VictorSotnikov14-Jan-10 22:38
VictorSotnikov14-Jan-10 22:38 
GeneralRe: Working with POP3 from Win32 application Pin
Stuart Dootson14-Jan-10 22:54
professionalStuart Dootson14-Jan-10 22:54 
AnswerRe: Working with POP3 from Win32 application Pin
Moak14-Jan-10 22:57
Moak14-Jan-10 22:57 
AnswerRe: Working with POP3 from Win32 application Pin
Joe Woodbury15-Jan-10 6:06
professionalJoe Woodbury15-Jan-10 6:06 
GeneralRe: Working with POP3 from Win32 application Pin
VictorSotnikov17-Jan-10 22:06
VictorSotnikov17-Jan-10 22:06 
GeneralRe: Working with POP3 from Win32 application Pin
Joe Woodbury17-Jan-10 22:17
professionalJoe Woodbury17-Jan-10 22:17 
QuestionNeed help in creating c++ stubs. Pin
Maya_14-Jan-10 20:37
Maya_14-Jan-10 20:37 
AnswerRe: Need help in creating c++ stubs. Pin
Richard MacCutchan14-Jan-10 21:19
mveRichard MacCutchan14-Jan-10 21:19 
QuestionWhich windows datatype to store LSN (Number upto 25 digits) Pin
s v joshi14-Jan-10 20:27
s v joshi14-Jan-10 20:27 
AnswerRe: Which windows datatype to store LSN (Number upto 25 digits) Pin
CPallini14-Jan-10 20:40
mveCPallini14-Jan-10 20:40 
GeneralRe: Which windows datatype to store LSN (Number upto 25 digits) Pin
Nelek14-Jan-10 20:44
protectorNelek14-Jan-10 20:44 
GeneralRe: Which windows datatype to store LSN (Number upto 25 digits) Pin
CPallini14-Jan-10 20:50
mveCPallini14-Jan-10 20:50 

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.