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

c++11 条件变量 | Zen's Blog #7

Open
xazeng opened this issue Aug 5, 2019 · 0 comments
Open

c++11 条件变量 | Zen's Blog #7

xazeng opened this issue Aug 5, 2019 · 0 comments

Comments

@xazeng
Copy link
Owner

xazeng commented Aug 5, 2019

https://code.xazeng.com/blog/2019/08/01/cpp/condition-variable/

比较常见的一个使用 std::condition_variable 场合就是线程池的消息队列。逻辑线程(可能多个)将消息推入消息队列,线程池中的工作线程(多个)会从消息队列中取出消息进行处理,如果队列中没有消息则进入睡眠状态等待消息。 本文将通过这种消息队列的实现,来分析如何使用 std::condition_variable 以及使用过程中的注意事项。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant