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

mavlink: lock sending messages outside #14673

Closed
wants to merge 1 commit into from

Conversation

julianoes
Copy link
Contributor

This is an attempt to prevent any of the 3 parts of a MAVLink message to end up on the buffer without the other parts. When partial messages end up on the buffer it will cause message drops because the parser reads too far and will miss the subsequent message.

By locking around the full process and preventing races between the message senders in the receiver thread and the actual sending threads we prevent message drops which e.g. leads to a cleaner initial param download.

This is an alternative to #12967. The param download works equally well, so 100% for the tested cases but CPU usage of the MAVLink threads is almost doubled, so this PR is clearly much worse.
I'm not sure why that's the case though it must have something to do with the locking.

For the test data, check: https://docs.google.com/spreadsheets/d/1aAT58x1zVd6_5bL9NjCOnc87Eoy4Aa3QMd-cmwZXI8A

This is an attempt to prevent any of the 3 parts of a MAVLink message to
end up on the buffer without the other parts. When partial messages end
up on the buffer it will cause message drops because the parser reads
too far and will miss the subsequent message.

By locking around the full process and preventing races between the
message senders in the receiver thread and the actual sending threads we
prevent message drops which e.g. leads to a cleaner initial param
download.
@julianoes julianoes requested review from dagar and bkueng April 15, 2020 12:16
@julianoes
Copy link
Contributor Author

#12967 is better, closing.

@julianoes julianoes closed this Apr 15, 2020
@julianoes julianoes deleted the pr-mavlink-send-locking branch April 15, 2020 15:36
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