LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CPU USAGE

I have a question. I am using a VIA motherboard at 800Mz and 512RAM. When I run my program it maxs out the CPU. All the program is doing is continuously taking data in from the device and using a data socket to stream it across the network to another computer.

My question is...is the CPU maxing out because I am trying to do to many things or because I am letting the while loop around my program run untethered? I was thinking of trying to put a small time delay in but I want to sample at the fast rate possible so it defeats the purpuse.
0 Kudos
Message 1 of 3
(3,248 Views)
If you're running on Windows, you can use the task manager to look at CPU loading, including networking, cpu, and memory and form an idea of what's happening.

Just do a CTRL-ALT-DEL and select task manager from the popup.

Process Monitor utility from Sysinternals is also quite good for characterizing PC performance.

Not knowing any more than what you've said so far, you could be CPU, memory, or network bound or all three. 

If you're doing synchronous i/o, then your code may be spin-locking or busy-waiting for input from your device - is it rs-232  or IEEE-488?

Menchar
0 Kudos
Message 2 of 3
(3,244 Views)
Hello All,
 
Here is an idea that may help solve the 100 % cpu usage issue.
 
Using embedded systems it is generally known to use an Interrupt Service Routine (ISR) to collect the "high" speed data.
Then the ISR would collect a network size packet. Once the packet is "FULL" the ISR would then generate or wake up a
sleeping task that would move the data across the network to a data storage task.
 
The question is does CVI provide a method to capture or generate interrupts?
 
djd
0 Kudos
Message 3 of 3
(3,201 Views)