-
Notifications
You must be signed in to change notification settings - Fork 11
Make ProgressThread::remove_function
less blocking
#265
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
base: branch-25.06
Are you sure you want to change the base?
Make ProgressThread::remove_function
less blocking
#265
Conversation
ProgressThread::remove_function
non-blockingProgressThread::remove_function
less blocking
@nirandaperera just to follow-up on our brief offline discussion, this is a way we could make the existing |
cpp/src/progress_thread.cpp
Outdated
std::lock_guard<std::mutex> lock(mutex_); | ||
for (auto& [id, function] : functions_) { | ||
function(); | ||
if (function.is_done) { | ||
completed_functions.push_back(id); | ||
completion_tracker_.mark_completed(id); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pentschev do you think we could traverse the functions_
map without holding the lock? I think that is the bottleneck in the current impl. And suspect that's why @madsbk 's PR of adding a small sleep helped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is in essence what you've implemented as well, done in 5956475 . (Again, not cleaned up for any resources that are now redundant)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me go through this
@pentschev I think we are on the same page here. I also sent a PR #266 which I think is a little more simpler. LMK what you think |
Track completed functions to make
ProgressThread::remove_function
less blocking.