connection-callback branch cpu usage is very high #567
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#567
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pls check it!
Let me describe it more clearly, when I don't plug in the device (0x0213, 0xA22C), the CPU usage is not high, but when I plug in the device, the CPU instantly rises to 9%~11%
Please provide more details about the device (eg: output from hidtest) and host PC configuration and OS you are using.
And the source for your
device_callbackfunction.Can you confirm that you're trying out the https://github.com/libusb/hidapi/tree/connection-callback branch on Windows?
I don't think anything abnormal is happening.
And BTW: what is the CPU usage when you plug your device, when your application isn't running at all?
On my end I only have 0.05% cpu usage when a device gets connected with the connection-callback branch and my application does a number of things at the same time. My config is Windows 11 and a 13600k cpu.
Make sure you keep your code in the callback as concise as possible. You can use a producer-consumer pattern with a FIFO to process those connections/disconnections in another thread.
@Alvazz
Any updates? Thanks.
We will close the issue if there are no responses.