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

Stop unused analysers, reduce the analysis frequency in the background #2806

Merged
merged 5 commits into from
Dec 11, 2020

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Dec 3, 2020

No description provided.

ksp_plugin/orbit_analyser.cpp Show resolved Hide resolved
ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved
ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved
ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved
@@ -182,10 +180,12 @@ Status OrbitAnalyser::RepeatedlyAnalyseOrbit() {
{
absl::MutexLock l(&lock_);
next_analysis_ = std::move(analysis);
// Take ownership of our own thread so we can safely detach.
analyser = std::move(analyser_);
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, the usual pattern to do this is to swap. This avoids having to reason about moved-from objects (analyzer_ becomes a well-defined, default-initialized jthread.

Sorry, something went wrong.

@pleroy pleroy added the LGTM label Dec 5, 2020
@eggrobin eggrobin merged commit 6ef7224 into mockingbirdnest:master Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants