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

Distribute Task Workload Across Threads Based on Thread Performance #7

Merged
merged 5 commits into from
Feb 24, 2022

Conversation

DeveloperPaul123
Copy link
Owner

@DeveloperPaul123 DeveloperPaul123 commented Feb 24, 2022

Summary

Switched to using a single task queue for all threads and a std::condition_variable_any to wake the threads when there is work available. This serves to better balance work loads and ensures the total work completes as quickly as possible.

Fixed

Changed

  • Removed front() and back() member functions from dp::thread_safe_queue.
  • Use a single task queue for all threads

Removed front() and back() functions and instead have pop() return a value
Switched to using a single queue with a condition variable to notify threads when work is available.
@DeveloperPaul123 DeveloperPaul123 merged commit 97578b0 into master Feb 24, 2022
@DeveloperPaul123 DeveloperPaul123 deleted the feature/thread-load-distribution branch February 24, 2022 19:30
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.

None yet

1 participant