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

C / C++ / MFC

 
GeneralRe: threads and their time slots. Pin
Souldrift3-Jul-09 2:50
Souldrift3-Jul-09 2:50 
AnswerRe: threads and their time slots. Pin
Keith Worden3-Jul-09 5:29
Keith Worden3-Jul-09 5:29 
GeneralRe: threads and their time slots. Pin
Souldrift3-Jul-09 6:04
Souldrift3-Jul-09 6:04 
AnswerRe: threads and their time slots. Pin
Souldrift3-Jul-09 6:07
Souldrift3-Jul-09 6:07 
GeneralRe: threads and their time slots. Pin
Keith Worden3-Jul-09 6:18
Keith Worden3-Jul-09 6:18 
GeneralRe: threads and their time slots. Pin
Souldrift3-Jul-09 6:39
Souldrift3-Jul-09 6:39 
AnswerRe: threads and their time slots. Pin
Souldrift3-Jul-09 6:48
Souldrift3-Jul-09 6:48 
AnswerRe: threads and their time slots. Pin
Souldrift3-Jul-09 7:34
Souldrift3-Jul-09 7:34 
One last thought.
I just tried to not let the thread sleep or create a wait object or anything.
I simply went into a while-loop. Endlessly. Where I fetched and printed the system time.
This was the result

RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781458000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781614000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.
RTPEngine: Time now = 128911153781770000.000000, send time = 12891115378155.598000.


And so on ... it always jumps 15,6ms forward. After it counted and counted it just jumps. Ar the time windows for a thread THAT small? Like smaller than 100ms?

The code was this one:

GetSystemTimeAsFileTime((FILETIME*)&ftNow);
now = double(ftNow.QuadPart);
m_pLogger->Out( Logger::DEBUG, "RTPEngine: Time now       = %f.\n", now );
			

int tmp = 0;
while( 1 )
{
	if( tmp >= 20 )
	{
		m_pLogger->Out( Logger::DEBUG, "RTPEngine: Time now = %f, send time = %f.\n", now, m_dPacketSendTime );
		tmp = 0;
	}
	tmp++;
	GetSystemTimeAsFileTime((FILETIME*)&ftNow);
	now = double(ftNow.QuadPart);
}


With thethoughts I wish you all a nice weekend ...

Souldrift
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 
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 

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.