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

Threading optimizations in DDS #11580

Merged
merged 6 commits into from
Mar 19, 2023
Merged

Threading optimizations in DDS #11580

merged 6 commits into from
Mar 19, 2023

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Mar 17, 2023

LibCI was hanging on some tests, mainly non-dds-related ones, because of timeouts. There were infinite waits somehow on the closing of resources.

This cleans up a lot and makes things much better.

  • refactored the reader-thread code to use all eprosima synchronization instead of the previous concurrency classes (dispatcher etc.)
  • made the device-watcher use a reader-thread
  • don't stop the dds watcher when a device is destroyed (we won't be able to pick up new devices!)
  • disable dds in run-unit-tests (the libCI wrapper)

This should fix libCI so I'll merge this first and then the other PRs...

@maloel maloel requested a review from OhadMeir March 17, 2023 12:23

rsutils::time::stopwatch stopwatch;
_on_data_available();
if( stopwatch.get_elapsed() > std::chrono::milliseconds( 500 ) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 500? Should be configurable, maybe FPS dependent.
Not for this PR but we should add a task to do it later

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, can be whatever we deem is right, I picked half a second rather arbitrarily.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to the todo list

Copy link
Contributor

@OhadMeir OhadMeir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maloel maloel merged commit 094ff52 into IntelRealSense:dds Mar 19, 2023
@maloel maloel deleted the threads branch March 19, 2023 08:17
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.

2 participants