Comments (7)
AFAIk hidapi is not thread-safe on neither of supported platforms
from hwi.
Do you have any links/documentation where they talk about thread safety? I find it very weird that it crashes even when the threads are properly synchronized. And it only happens in one specific os/arch combination, not on x86 macos or arm linux.
from hwi.
Hm, I might be wrong. I only found this 11 years old comment: signal11/hidapi#56 (comment)
On Linux and Mac, HIDAPI is fully thread-safe.
On Windows, it mostly is. You should be able to read and write at the same time like you're saying. One thing that won't work is using hid_close() to stop a hid_read() which is on another thread.
from hwi.
@afilini do you see the same failure with the following code?
import hid
import threading
def e():
m.acquire()
print(hid.enumerate())
m.release()
m = threading.Lock()
a = threading.Thread(target=e, args=())
b = threading.Thread(target=e, args=())
c = threading.Thread(target=e, args=())
a.start()
b.start()
c.start()
a.join()
b.join()
c.join()
If yes, we can close this issue and open a new one in https://github.com/trezor/cython-hidapi because the issue is not in hwi but rather in cython-hidapi.
from hwi.
Yep, same issue
from hwi.
Closing as this is an usptream issue.
from hwi.
Created trezor/cython-hidapi#148 to continue there
from hwi.
Related Issues (20)
- Signing a P2WSH multisig input fails on updated Ledger firmware & Bitcoin app HOT 7
- [rfc] Require emulator/simulator for device support
- Base58 decode_check always returns invalid checksum HOT 2
- Ledger: Unable to sign non-standard derivation paths
- Support displaying Taproot addresses on Coldcard Edge (6+) firmware
- Bitbox fails to sign PSBT HOT 6
- ci bug HOT 1
- Support Trezor Safe 3 HOT 6
- Documentation: Typo?
- Trezor T can't sign >100 inputs HOT 12
- [Feature Request] Add ability to pass cli arguments with stdin HOT 3
- Windows thinks hwi.exe is a trojan HOT 8
- HWI issue with Trezor One and Sparrow (slow loading times)
- Conflict when more than wallet is connected via USB HOT 3
- pyside2 is deprecated, use pyside6 HOT 1
- Windows thinks the linux distribution is a trojan HOT 1
- Build with ubuntu-20.04 rather than ubuntu-latest HOT 2
- Any plan to support QA based AirGap Bitcoin hardware wallet ? HOT 2
- ✅
- The currently released 3.0.0 Linux binaries fail on Ubuntu 20.04 with `version 'GLIBC_2.35' not found`.
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 hwi.