We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if (is_waiting) { std::unique_lock<std::mutex> locker(lok); task_done_workers++; task_done_cv.notify_one(); thread_cv.wait(locker); }
这是在workbranch.hpp里面的mission函数的一段代码,这段代码最后的 thread_cv.wait(locker) 应该改为 thread_wait(locker,!is_waiting) 吗?否则伪唤醒可能让一个没有任务的线程一直执行yield()函数,导致资源浪费.
The text was updated successfully, but these errors were encountered:
确实存在伪唤醒,但是问题在于多一次循环后task_done_workers++导致计数不准。
Sorry, something went wrong.
No branches or pull requests
这是在workbranch.hpp里面的mission函数的一段代码,这段代码最后的 thread_cv.wait(locker) 应该改为 thread_wait(locker,!is_waiting) 吗?否则伪唤醒可能让一个没有任务的线程一直执行yield()函数,导致资源浪费.
The text was updated successfully, but these errors were encountered: