-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win32: Hangs forever in hid_read_timeout() when calling hid_close() #649
Comments
That is only true, due to the library missing synchronization function calls during read()/write() operations and close(). I also mentioned this in: #133 e.i, by implementing a simple EnterCriticalSection()/ExitCriticalSection() construct in the win32 port, the problem you are describing would not be there. If I find the time, I will propose a patch to show how this would look. |
You just faild to consider all multi-threading scenarios. |
What you are stating is true and is basic teachings in operating system problematics. https://man7.org/linux/man-pages/man2/close.2.html This is discussed probably in all O/S classes at least once.... However, I have never seen this as an argument to not have any synchronization, and to enforce completely random behavior as a result. Argument is correct, conclusion is odd. With this logic, we should remove all synchronization from all libraries, drivers, operating system, etc. on the planet, as they, like here, suffer the same problem. The rest of the world solves this with external synchronization and a note in the manual that states that "any call to any file operation after close() is not defined and not supported". I do not see why a simple library like hidapi should be any different. You are limiting hidapi to never be used in a multi-threaded environment because of an irritation with the unsolvable close() problem that haunts every file system programmer. Live with it, and document that hidapi does not not, like other systems, solve this. |
Lets continue this discussin in one place: #133 |
As the title states, the problems reported earlier around GetOverlappedResult() is still present.
There where attempted fixed in:
#128
signal11/hidapi#88
But for some simple scenarios this is still the case:
The text was updated successfully, but these errors were encountered: