Skip to content
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

replace busy polling with pthread_cond_wait #99

Open
ballle98 opened this issue Dec 9, 2019 · 1 comment · May be fixed by #100
Open

replace busy polling with pthread_cond_wait #99

ballle98 opened this issue Dec 9, 2019 · 1 comment · May be fixed by #100

Comments

@ballle98
Copy link
Contributor

ballle98 commented Dec 9, 2019

There are several instances where synchronization between the main thread, and the worker threads is done through variables. Polling these variables at different intervals waiting for a state change. A better way to do this is with mutex and conditions.

Using conditions and mutexes prevents race conditions and insures consistent operation. In PDA mode this means a worker can wait on a STATUS message and make a decision then send a keypress in the ACK for the STATUS it was waiting on. No missed transitions, retries, and lost time.

@ballle98
Copy link
Contributor Author

updated pull request to version 2.2.2a++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant