Quote:
Originally Posted by taoyue
Unlikely. If that {polling loop} were the problem, then S&T would be eating 100% CPU (or 50% on a dual-core CPU) all the time, rather than just as the crash occurs. ...
There is no reason that a polling loop would chew up an inordinate amount of CPU when it's working properly. In the case of a GPS receiver which transmits data, say, once every second the polling loop would only need to run once per second. It's such a tiny amount of code that each iteration of the loop would take a miniscule amount of CPU time to complete.
I've programmed dozens of data acquisition routines; probably split roughly equally between polling loops and interrupt driven, depending on the operating system and the driver and hardware capabilities. I was doing this back in the minicomputer days when most hardware devices didn't come with drivers because there were no "standard" operating systems. They were all proprietary to the computer they ran on. And even in those days of puny CPUs and system memory measured in kBytes there was little overhead for polling loops, properly coded.
In the context of modern CPUs there would be no visible difference on the CPU performance monitor between the two.
If the increase in CPU utilization is related to the data acquision routine - and it might well be - that's a symptom of either a buggy data acquisition routine or, more likely, something getting screwed up in the heap, a memory leak, or or something similar causing the data acquisition loop to go into hyperdrive.
...ken...