Comments (13)
0.13 already includes a lot of good improvements, so I guess making a release (before Christmas) would be a good thing regardless if it is going to include the multithreaded documentation/fixes or not
from hidapi.
It is great that you have released hidapi 0.13. Thanks.
from hidapi.
Oh yes, HIDAPI on macOS has an additional issue regarding thread-safety. I did encountered it in my project(s) but didn't have enough time to gather info/find a root cause. Looks like on macOS
hid_init/hid_exit
needs to be called in the same thread, which is an additional restriction compared to other platforms.
I have a potential solution, described fully in #666
from hidapi.
NOTE for everyone: hidapi not thread-safe in general, with a few platform-specific/usage-spacific exceptions.
Damn, I need to get my hands to describe everything in details.
from hidapi.
Reference: Windows: unable to interrupt blocking hid_read call #133
from hidapi.
I see this and #133 are tied to 0.13.0 milestone. Supposedly this one will "help" #133, right?
Any activities on this one?
#146 is supposed to fix #133, but I see no activities there.
from hidapi.
@Youw
Just wondering what is the plan for 0.13.0 release, say as a Christmas gift. :-)
from hidapi.
0.13 already includes a lot of good improvements, so I guess making a release (before Christmas) would be a good thing regardless if it is going to include the multithreaded documentation/fixes or not
I agree. Thanks.
from hidapi.
Reference by Youw.
As for multithreaded usage of hidapi - many projects successfully using a separate thread for hid_read/_timeout, and another thread for read/everything else.
from hidapi.
Another reference by Youw.
client code should first stop any read/write attempts before trying to close the device as hid_close cannot not be thread-safe by design, even it it is sometime, for some implementations.
from hidapi.
Add a stub FAQ entry here.
https://github.com/libusb/hidapi/wiki#faq
from hidapi.
Comments by Youw here.
Oh yes, HIDAPI on macOS has an additional issue regarding thread-safety. I did encountered it in my project(s) but didn't have enough time to gather info/find a root cause. Looks like on macOS
hid_init/hid_exit
needs to be called in the same thread, which is an additional restriction compared to other platforms.
from hidapi.
Reference from node-hid.
https://github.com/node-hid/node-hid#thread-safety-worker-threads-context-aware-modules
Thread safety, Worker threads, Context-aware modules
In general node-hid
is not thread-safe because the underlying C-library it wraps (hidapi
) is not thread-safe. However, node-hid
is now reporting as minimally Context Aware to allow use in Electron v9+. Until node-hid
(or hidapi
) is rewritten to be thread-safe, please constrain all accesses to it via a single thread.
from hidapi.
Related Issues (20)
- Call to `hid_read_timeout` sometimes never returns on Windows HOT 1
- ImportError of usblib libraries HOT 3
- Why need sudo for libhidapi-libusb and not for libhidapi-hidraw? HOT 4
- Linux / hidraw flock support? HOT 1
- Meson build system cannot be used for cross builds HOT 4
- spacemouse
- [MacOS] Potential issues reported by clang (low to medium priority)
- Getting undefined reference to 'hid_get_report descriptor' and 'hid_get_device_info' when compiling/linking test.c HOT 1
- Potential solution to MacOS hid_init/hid_exit issue HOT 4
- Cannot compile hidapi 1.5.0 on macos HOT 3
- need longer timeout with send_feature_report() for libusb under Windows HOT 3
- Warnings HOT 3
- Consern regarding Hotplug callbacks implementation HOT 1
- warning: [email protected]: cc1: fatal error: etc/hidapi/linux/hid.c: No such file or directory HOT 1
- Hello, does hidapi currently support iPhone 15 devices with iOS system and iPad devices with USB interface HOT 1
- mistake in name HOT 3
- libusb backend: "hid_error is not implemented yet" HOT 2
- How to test it in Android with HIDAPI? HOT 1
- Windows&libusb: hid_write Issue: hid_write/WaitForSingleObject: (0x000003E5) Overlapped I/O operation is in progress. (Regression from signal11 version, 1 sec write timeout issue!) HOT 8
- Doesnt work properly on windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hidapi.