Post your Linux discussions here
- Posts: 0
- Joined: Tue Mar 26, 2019 8:44 am
Ok, so I have now managed to get a small program up and running which is essentially a slightly modified version of picohrdlCon.c. The main loop basically looks like this:
However, even though I only get roughly one measurement per second picohrdlCon is using 40% CPU. By using strace it seems as if the library busy-waits until data arrives from the USB bus.
Code: Select all
To avoid this I tried to modify CollectStreaming() instead under the theory that the library was not really optimized for the CollectSingleBlocked() use-case. However, when I call HRDLGetValues() it still seems as if the library uses busy-waiting since I now manage to get up to 100% CPU usage. (At least if I remove the 2000ms sleep.)
Unlike the other issues I mentioned in a few previous posts I really do not see any feasible way to get close to real-time data with the current software library without paying a huge price in CPU-usage. Do you have any advice here?
- PICO STAFF
- Posts: 2855
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
This is an issue that we have been made aware of previously and has recently been fixed in the driver. I am unable to advise when the fix will be made available but do check for updates to the driver package in a few weeks.
Software Dev. Engineer