Click here to Skip to main content
15,896,118 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCan STL vector cross DLL boundaries? Pin
unjedai14-Feb-06 8:30
unjedai14-Feb-06 8:30 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Michael Dunn14-Feb-06 10:14
sitebuilderMichael Dunn14-Feb-06 10:14 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Jeff Thompson14-Feb-06 10:17
Jeff Thompson14-Feb-06 10:17 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Stephen Hewitt14-Feb-06 11:28
Stephen Hewitt14-Feb-06 11:28 
AnswerRe: Can STL vector cross DLL boundaries? Pin
Anthony_Yio14-Feb-06 15:37
Anthony_Yio14-Feb-06 15:37 
QuestionStrange variations Pin
hint_5414-Feb-06 8:27
hint_5414-Feb-06 8:27 
AnswerRe: Strange variations Pin
David Crow14-Feb-06 9:46
David Crow14-Feb-06 9:46 
GeneralRe: Strange variations Pin
hint_5415-Feb-06 6:22
hint_5415-Feb-06 6:22 
"QueryPerformanceCounter returns a reasonably accurate rendering of time, at least on Intel platforms. This is because on Intel platforms it returns the contents of a "cycle counter", converted to timing units based on the processor frequency. Because the cycle counter actually counts the number of CPU cycles, it gives a reasonable approximation of real time. However, executing the same loop twice may give different results because the presence or absence of data in the cache will change the number of cycles required to execute the program. So it is at best an approximation, and you have to do some more careful statistical analysis to figure out what is really going on."

This was quoted from the link that you have provided earlier.

Does this mean it is all about cache? If so, please assume the following code then:

int main( void )
{
int *ptr, i;
for ( i=0 ; i<100 ; i++ ) {
ptr = new int;
delete ptr;
}
return 0;
}

So, after "i=0", "i" gets in the cache. After the first time it executs "ptr = new int" "ptr" gets in cache too. From now on, all the 100 cicles will use "i" and "ptr" and these are supposed to be already cached, right? The only thing that I can see that is not cached is "*i", but I never access it directly (or do I? D'Oh! | :doh: ). So, I understand why the first values show a small variation (after the first 4 or 5 cicles it stabilizes), but I still don't understand why those variations keep showing up along the whole test (unless I'm really accessing "*i").

Anyone? Smile | :)

regards

hint_54
AnswerRe: Strange variations Pin
Stephen Hewitt14-Feb-06 11:34
Stephen Hewitt14-Feb-06 11:34 
AnswerRe: Strange variations Pin
Dan McCormick14-Feb-06 13:37
Dan McCormick14-Feb-06 13:37 
GeneralRe: Strange variations Pin
hint_5415-Feb-06 5:36
hint_5415-Feb-06 5:36 
NewsRe: Strange variations Pin
Dan McCormick15-Feb-06 11:10
Dan McCormick15-Feb-06 11:10 
QuestionFormat of data in writing file , on different Windows Pin
zahid_ash14-Feb-06 8:14
zahid_ash14-Feb-06 8:14 
AnswerRe: Format of data in writing file , on different Windows Pin
Red Stateler14-Feb-06 8:57
Red Stateler14-Feb-06 8:57 
QuestionSerial port interfacing Pin
srija14-Feb-06 7:02
srija14-Feb-06 7:02 
AnswerRe: Serial port interfacing Pin
Milton Karimbekallil14-Feb-06 8:16
Milton Karimbekallil14-Feb-06 8:16 
AnswerRe: Serial port interfacing Pin
Dan McCormick14-Feb-06 8:29
Dan McCormick14-Feb-06 8:29 
QuestionWinsock2.h and "unresolved external error" Pin
Mutty14-Feb-06 6:53
Mutty14-Feb-06 6:53 
AnswerRe: Winsock2.h and "unresolved external error" Pin
James R. Twine14-Feb-06 6:57
James R. Twine14-Feb-06 6:57 
GeneralRe: Winsock2.h and &quot;unresolved external error&quot; Pin
Mutty14-Feb-06 7:23
Mutty14-Feb-06 7:23 
GeneralRe: Winsock2.h and "unresolved external error" Pin
ThatsAlok14-Feb-06 22:22
ThatsAlok14-Feb-06 22:22 
AnswerRe: Winsock2.h and "unresolved external error" Pin
David Crow14-Feb-06 7:00
David Crow14-Feb-06 7:00 
Questioninlining problem Pin
hint_5414-Feb-06 6:21
hint_5414-Feb-06 6:21 
AnswerRe: inlining problem Pin
Chris Losinger14-Feb-06 6:33
professionalChris Losinger14-Feb-06 6:33 
GeneralRe: inlining problem Pin
hint_5414-Feb-06 6:36
hint_5414-Feb-06 6:36 

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.