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
void OrbitAnalyser::Restart() {
analyser_ = MakeStoppableThread([this] { RepeatedlyAnalyseOrbit(); });
void OrbitAnalyser::Interrupt() {
analyser_ = jthread();
Copy link
Member

Choose a reason for hiding this comment

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

I would request_stop and detach (only if the thread is joinable, of course). The thread would immediately become non-joinable, and could happily execute for a while until it notices the stop. You could then drop the analyzer_done_ boolean since it would effectively be subsumed by joinable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Rewrote as discussed.

ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved
ksp_plugin/orbit_analyser.cpp Outdated Show resolved Hide resolved
@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