Click here to Skip to main content
15,888,401 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SetTimer Pin
David Crow31-Oct-11 3:10
David Crow31-Oct-11 3:10 
AnswerRe: SetTimer Pin
Luc Pattyn31-Oct-11 3:12
sitebuilderLuc Pattyn31-Oct-11 3:12 
AnswerRe: SetTimer Pin
Erudite_Eric31-Oct-11 3:50
Erudite_Eric31-Oct-11 3:50 
AnswerRe: SetTimer Pin
Chuck O'Toole31-Oct-11 10:06
Chuck O'Toole31-Oct-11 10:06 
GeneralRe: SetTimer Pin
Erudite_Eric31-Oct-11 21:12
Erudite_Eric31-Oct-11 21:12 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 2:58
Chuck O'Toole1-Nov-11 2:58 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 3:07
Erudite_Eric1-Nov-11 3:07 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 3:18
Chuck O'Toole1-Nov-11 3:18 
Erudite__Eric wrote:


Chuck O'Toole wrote:
Plus the user's loop is already
preventing message processing, adding a Sleep()
call will only *lengthen*
the amount of time he's chewing up

 
No, quite the
opposite. A sleep() surrenders the rest of that threads timeslice, it doesnt
chew up cycles, it frees them.
 
And if Microsoft recomends that then
I am surprised. Work intensive code should go in a seperate thread to the UI.



If you're going to quote me, use the whole quote, not the part that makes it sound like the opposite of what I said. The actual quote should be:

Chuck O'Toole wrote:
Plus the user's loop is already preventing message processing, adding a Sleep()
call will only *lengthen* the amount of time he's chewing up (real time, not cpu
cycles obviously).


The parenthetical states that it's not the CPU Cycles but the "Clock On The Wall Cycles". Sleep() adds code to the loop, is a system call that adds more code being executed in the loop, and, even with Sleep(0) to quit the timeslice, still causes a complete scheduler cycle to look for other runnable threads before returning to this thread.
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 3:30
Erudite_Eric1-Nov-11 3:30 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 3:44
Chuck O'Toole1-Nov-11 3:44 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 4:48
Erudite_Eric1-Nov-11 4:48 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 5:11
Chuck O'Toole1-Nov-11 5:11 
GeneralRe: SetTimer Pin
Erudite_Eric1-Nov-11 6:43
Erudite_Eric1-Nov-11 6:43 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 7:51
Chuck O'Toole1-Nov-11 7:51 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Goto_Label_1-Nov-11 9:17
Goto_Label_1-Nov-11 9:17 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Chuck O'Toole1-Nov-11 10:14
Chuck O'Toole1-Nov-11 10:14 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Erudite_Eric2-Nov-11 7:02
Erudite_Eric2-Nov-11 7:02 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Chuck O'Toole2-Nov-11 9:16
Chuck O'Toole2-Nov-11 9:16 
GeneralRe: MSDN:Preventing Hangs in Windows Applications Pin
Erudite_Eric2-Nov-11 11:25
Erudite_Eric2-Nov-11 11:25 
Generale: SetTimer Pin
Erudite_Eric1-Nov-11 22:06
Erudite_Eric1-Nov-11 22:06 
GeneralRe: SetTimer Pin
David Crow1-Nov-11 9:29
David Crow1-Nov-11 9:29 
GeneralRe: SetTimer Pin
Chuck O'Toole1-Nov-11 10:16
Chuck O'Toole1-Nov-11 10:16 
AnswerRe: SetTimer Pin
Mark Salsbery31-Oct-11 12:32
Mark Salsbery31-Oct-11 12:32 
GeneralRe: SetTimer Pin
Chuck O'Toole31-Oct-11 12:59
Chuck O'Toole31-Oct-11 12:59 
GeneralRe: SetTimer Pin
Mark Salsbery31-Oct-11 14:48
Mark Salsbery31-Oct-11 14:48 

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.