LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer() function return value strange with CPU dual core

Hi to all,
I had replace the CPU uniprocessor with a new CPU Dual Core on my computer.
After this all my CVI application working strange. The return value of function Timer() is more than before and my application timing are fault.
Timing check for my procedure is:
 
void Run(void)
{
     double time=Timer();
     int running=1;
 
     while (running)
     {
            callProcedure();
 
            // call the procedure for 5 seconds
            if (Timer()>=time+5)
                  running = 0;//set the flag to exit
     }       
}
 
Why Timer() working different between CPU uniprocessor and CPU multiprocessor?
How I can solve my problem?
 
Thanks.
0 Kudos
Message 1 of 2
(3,165 Views)
Generally, you would expect execution times to be different for dual core Vs. single core in a multi-threaded scenario (either a multi-threaded application or multiple processes).  Shorter execution times are due to true execution concurrency (or parallelism in Intel-speak).

The first question might be, how do you know that the process isn't just taking more time to execute and that the timer function is working correctly?

If NI is using performance timers there could be an issue.    There are reports of QueryPerformanceCounter being goofed on multicore AMD's.  Also RDTSC Pentium instruction has multicore issues too apparently.  And the Intel SpeedStep technology, which clocks down the CPU when it is idle, could goof timing calculations depending upon the implementation.

This is interesting especially since NI is claiming milticore prowess with CVI 8.5.

Menchar
0 Kudos
Message 2 of 2
(3,147 Views)