Repository Details
Shared by
HelloGitHub Rating
0 ratings
一个简单的 C++11 线程池实现,代码加起来不到 100 行
Past 6 days Received 0 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周日 | 8,828 | — |
| 周一 | 8,828 | 0 |
| 周二 | 8,829 | +1 |
| 周三 | 8,828 | -1 |
| 周四 | 8,827 | -1 |
| 周五 | 8,828 | +1 |
8.8k
Stars
No
Chinese
C++
Language
No
Active
3
Contributors
61
Issues
No
Organization
None
Latest
2k
Forks
Zlib
License
一个简单的 C++11 线程池实现,代码加起来不到 100 行。示例代码:
```c++
// create thread pool with 4 worker threads
ThreadPool pool(4);
// enqueue and store future
auto result = pool.enqueue([](int answer) { return answer; }, 42);
// get result from future
std::cout << result.get() << std::endl;
```
Included in:
Vol.45
Comments
Rating:
No comments yet