-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
LTOBD2Adapter: Race Condition in Command Queue Access #22
Comments
Tested this in debug and _commandQueue is between 1 and 6 after adding commands. i will try it with this solution:
after: asyncProcessCommandQueue |
Thanks for this report. The actual problem looks like a multithreading race condition – I should check whether access of the command queue is a) coordinated or b) make the command queue thread-safe. That said, if you're checking values in a loop, you have to take care that you're not adding commands faster than they are handled, so instead of adding based on a timer it would be better to use the completion handler to schedule the next iteration. Last but not least, there are several optimizations that I want to tackle in 2019, namely adding facilities to group multiple PID queries (in order to save bandwidth), and also something to ease repeating queries. |
created an outlet for the queue count and slow down the new requests if needed. |
Have you any idea how to fix this ? I start the "transmitMultipleCommands" function in the main queue but it doesn´t help. |
This Error only happens all >50.000 readings so its hard to find the error but i think this might be help.
|
@synchronized(self) is not the solution. |
created pull request for the solution. #26 |
Can you help me to figure out what has happend. I record over 30 Minutes rpm and speed and 4 Other values.
The text was updated successfully, but these errors were encountered: