Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: threads and their time slots. Pin
Souldrift3-Jul-09 7:34
Souldrift3-Jul-09 7:34 
GeneralRe: threads and their time slots. Pin
Stuart Dootson3-Jul-09 8:33
professionalStuart Dootson3-Jul-09 8:33 
GeneralRe: threads and their time slots. Pin
Roger Stoltz3-Jul-09 8:41
Roger Stoltz3-Jul-09 8:41 
GeneralRe: threads and their time slots. Pin
Stuart Dootson3-Jul-09 8:50
professionalStuart Dootson3-Jul-09 8:50 
GeneralRe: threads and their time slots. Pin
Roger Stoltz3-Jul-09 8:55
Roger Stoltz3-Jul-09 8:55 
GeneralRe: threads and their time slots. Pin
Souldrift5-Jul-09 21:37
Souldrift5-Jul-09 21:37 
GeneralRe: threads and their time slots. Pin
Stuart Dootson5-Jul-09 21:43
professionalStuart Dootson5-Jul-09 21:43 
GeneralRe: threads and their time slots. [modified] Pin
Souldrift5-Jul-09 22:19
Souldrift5-Jul-09 22:19 
Okay, I thought so (after some thinking). Now if you will bear with me one more time, I´m not quite sure how to understand (handle) this regarding my case.
For example if I use this (cause 9ms are appx. the time I need to wait before sending)

CreateTimerQueueTimer(&hTimer, hTimerQueue, (WAITORTIMERCALLBACK)&DoSendHere, 0 , 9, 1, WT_EXECUTEINTIMERTHREAD);
QueryPerformanceCounter(&liStart);
::SleepEx(65, TRUE);


The callback func should with a 65ms sleep be called like 7 times. Though my log shows 54.
I guess, this is because the timer doesn´t stop after my sleep or my sending. So the next question would be, how do I stop it? I know, i doesn´t even have to be periodic for what I need (so it would stop by itself), but I´m trying to understand the structure. I added a DeleteTimerQueueEx( hTimerQueue, NULL ); but it crashes now at that point.

Souldrift

Edit: And why does it not call the callback func when I take away the sleepEx()?? Is it dependant on the thread being asleep?
If I do this
CreateTimerQueueTimer(&hTimer, hTimerQueue, (WAITORTIMERCALLBACK)&DoSendHere, 0 , 1, 0, WT_EXECUTEINTIMERTHREAD);
QueryPerformanceCounter(&liStart);
::SleepEx(10, TRUE);


it doesn´t enter, either.

modified on Monday, July 6, 2009 4:32 AM

GeneralRe: threads and their time slots. Pin
Stuart Dootson5-Jul-09 23:30
professionalStuart Dootson5-Jul-09 23:30 
AnswerRe: threads and their time slots. Pin
Roger Stoltz3-Jul-09 8:39
Roger Stoltz3-Jul-09 8:39 
QuestionHow to make truncation in C++ Pin
alikalik2-Jul-09 22:06
alikalik2-Jul-09 22:06 
AnswerRe: How to make truncation in C++ Pin
Rajesh R Subramanian2-Jul-09 22:09
professionalRajesh R Subramanian2-Jul-09 22:09 
GeneralRe: How to make truncation in C++ Pin
alikalik2-Jul-09 22:14
alikalik2-Jul-09 22:14 
GeneralRe: How to make truncation in C++ Pin
Rajesh R Subramanian2-Jul-09 22:16
professionalRajesh R Subramanian2-Jul-09 22:16 
AnswerRe: How to make truncation in C++ Pin
Stuart Dootson2-Jul-09 22:16
professionalStuart Dootson2-Jul-09 22:16 
AnswerRe: How to make truncation in C++ Pin
Michael Schubert2-Jul-09 22:19
Michael Schubert2-Jul-09 22:19 
GeneralRe: How to make truncation in C++ Pin
CPallini2-Jul-09 22:36
mveCPallini2-Jul-09 22:36 
GeneralRe: How to make truncation in C++ Pin
Rajesh R Subramanian2-Jul-09 22:50
professionalRajesh R Subramanian2-Jul-09 22:50 
GeneralRe: How to make truncation in C++ Pin
CPallini2-Jul-09 22:56
mveCPallini2-Jul-09 22:56 
AnswerRe: How to make truncation in C++ Pin
KarstenK3-Jul-09 3:21
mveKarstenK3-Jul-09 3:21 
AnswerRe: How to make truncation in C++ Pin
Dan3-Jul-09 10:21
Dan3-Jul-09 10:21 
GeneralRe: How to make truncation in C++ Pin
Michael Schubert3-Jul-09 12:19
Michael Schubert3-Jul-09 12:19 
QuestionHow to make a LONGLONG array ? Pin
krish_kumar2-Jul-09 21:25
krish_kumar2-Jul-09 21:25 
AnswerRe: How to make a LONGLONG array ? Pin
«_Superman_»2-Jul-09 21:30
professional«_Superman_»2-Jul-09 21:30 
GeneralRe: How to make a LONGLONG array ? Pin
krish_kumar2-Jul-09 21:50
krish_kumar2-Jul-09 21: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.