superBasem / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

Very busy read{Timeout} #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When I JVisualVM profile my USB application, reading the USB device is eating 
up a whole thread – is there no way to make this asynchronous (or yield the 
thread until data is available) and save CPU cycles?

My device is running at about 170Hz and that means about 7 milliseconds wait 
per report acquisition. That's too low for me to be able to do anything 
sensible with Thread.sleep, but high enough that it's eating 93% of that 
thread's time.

Strategies to save cycles would be greatly appreciated.

Link to my project and the issue report there:

  https://github.com/fommil/emokit-java/issues/7

Original issue reported on code.google.com by Sam.Hall...@gmail.com on 30 Dec 2012 at 3:18