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

avoid 2 atomic locks on inbox process #176

Closed
wants to merge 2 commits into from

Conversation

tprifti
Copy link
Contributor

@tprifti tprifti commented Jan 5, 2025

if inbox contained messages, the procStatus was changed from running to idle and from idle to running immediately. We can avoid this multiple atomic swap by checking the ring buffer length. If there are no messages, the procStatus can be safely changed to idle.

@tprifti tprifti marked this pull request as draft January 6, 2025 00:38
@tprifti
Copy link
Contributor Author

tprifti commented Jan 6, 2025

as discussed on Discord, the proposed solution may cause messages not to be processed. It's safer to switch the procStatus before checking for rb messages.

@tprifti tprifti closed this Jan 6, 2025
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 this pull request may close these issues.

1 participant