Click here to Skip to main content
15,929,721 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Button and focus Pin
ArielR24-May-07 2:57
ArielR24-May-07 2:57 
GeneralRe: Button and focus Pin
CPallini24-May-07 3:19
mveCPallini24-May-07 3:19 
Questionpreemption for 16ms Pin
Nir sheffi24-May-07 1:25
Nir sheffi24-May-07 1:25 
AnswerRe: preemption for 16ms Pin
Roger Stoltz24-May-07 1:35
Roger Stoltz24-May-07 1:35 
GeneralRe: preemption for 16ms Pin
Nir sheffi24-May-07 1:57
Nir sheffi24-May-07 1:57 
GeneralRe: preemption for 16ms Pin
CPallini24-May-07 2:14
mveCPallini24-May-07 2:14 
GeneralRe: preemption for 16ms Pin
Nir sheffi24-May-07 2:45
Nir sheffi24-May-07 2:45 
GeneralRe: preemption for 16ms Pin
Roger Stoltz24-May-07 2:20
Roger Stoltz24-May-07 2:20 
Nir sheffi wrote:
I would expect the behavior to be inconsistent.......but in this case on the behavior is consistent on some machines 1-2ms and on the others 16ms.


Ok, so what is your question? Confused | :confused:

The articles I linked to in my previous post gives you multiple reasons to why you won't get the control back within 1 ms if you call ::Sleep( 1 ). If you want to pinpoint exactly the reason why this is happening on the machines you've tested, I cannot help you with that for two reasons:
1. It would be a tedious job to track the reason down and it would presumably require investigation of the machines and how they are set up.
2. When the reason is found we cannot do anything about it. There's no way to change the behaviour since this is how the system works. It would simply be a waste of time.

My approach is more pragmatic...
It doesn't matter what the exact reason is in this case. On another machine it would be another reason. The fact is that ::Sleep() gives unpredictable results and if time is of the essence you should find an alternative solution, such as multimedia timers which would give the best resolution on a windows OS.
Don't spend time tracking the exact reason down because you cannot use that information for anything. It can be interesting from a technical point of view, but then you're on your own. Wink | ;)


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

AnswerRe: preemption for 16ms Pin
Randor 24-May-07 3:28
professional Randor 24-May-07 3:28 
GeneralRe: preemption for 16ms Pin
Roger Stoltz24-May-07 4:24
Roger Stoltz24-May-07 4:24 
GeneralRe: preemption for 16ms Pin
Randor 24-May-07 10:33
professional Randor 24-May-07 10:33 
GeneralRe: preemption for 16ms Pin
Roger Stoltz24-May-07 21:04
Roger Stoltz24-May-07 21:04 
GeneralRe: preemption for 16ms Pin
Randor 25-May-07 4:27
professional Randor 25-May-07 4:27 
GeneralRe: preemption for 16ms Pin
Roger Stoltz27-May-07 12:16
Roger Stoltz27-May-07 12:16 
QuestionAnyone know how I can install this addin? Pin
Stick^24-May-07 1:23
Stick^24-May-07 1:23 
AnswerRe: Anyone know how I can install this addin? Pin
David Crow24-May-07 3:12
David Crow24-May-07 3:12 
Questionlstrlen problem Pin
si_6924-May-07 0:36
si_6924-May-07 0:36 
AnswerRe: lstrlen problem Pin
James R. Twine24-May-07 0:49
James R. Twine24-May-07 0:49 
GeneralRe: lstrlen problem Pin
si_6924-May-07 0:52
si_6924-May-07 0:52 
GeneralRe: lstrlen problem Pin
James R. Twine24-May-07 1:00
James R. Twine24-May-07 1:00 
GeneralRe: lstrlen problem Pin
Naveen24-May-07 1:01
Naveen24-May-07 1:01 
QuestionIs my approach feasible? C++ Pin
C_Zealot24-May-07 0:26
C_Zealot24-May-07 0:26 
AnswerRe: Is my approach feasible? C++ Pin
Christian Graus24-May-07 0:50
protectorChristian Graus24-May-07 0:50 
AnswerRe: Is my approach feasible? C++ Pin
James R. Twine24-May-07 0:51
James R. Twine24-May-07 0:51 
GeneralRe: Is my approach feasible? C++ Pin
C_Zealot24-May-07 0:52
C_Zealot24-May-07 0:52 

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.