Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Constant execution time on P4?

arintel1
Beginner
411 Views
Dear friends,
In theory, can we achieve constant execution time on Pentium 4 (with and without Hyper-Threading Technology) ? How?
Sincerely,
ARINTEL
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
411 Views
Hi,
what do you mean? Constant execution time for some program, which will be the same each time it runned? With clock-to-clock accuracy?
Regards,
Vladimir
0 Kudos
arintel1
Beginner
411 Views
Hi,

That's exactly what I meant.

I tried the following things with the routine that I wanted to have constant execution time:
1. Put it in kernel mode of Windows XP running at the highest IRQL (31) -> only be interrupted by NMI
2. The routine contains a loop which repeats 10 times the same task: processing data and measuring CPU clock cycle. I take the last measurement as the final result.
3. On P4 with Hyperthreading, I made the second logical processor get stuck in a spin loop while the other processor was processing the routine.

With those things, I could achieve 99.99% constant execution time for the routine on all Celerons and Pentiums except Pentium 4 (with or without HyperThreading).

On P4,the measurement result constantly fluctuates in some range, though small.

Thanks!
0 Kudos
Vladimir_Dudnik
Employee
411 Views
Hi,
there are might be many reasons for that. For example hardware prefetcher on Pentium 4 can optimize memory accesses after it accumulate enough history.
Regards,
Vladimir
0 Kudos
Reply