Repository Details
Shared by
HelloGitHub Rating
0 ratings
一个简单的 C++11 线程池实现,代码加起来不到 100 行
Past 6 days Received 1 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周六 | 8,831 | — |
| 周日 | 8,830 | -1 |
| 周一 | 8,832 | +2 |
| 周二 | 8,833 | +1 |
| 周三 | 8,832 | -1 |
| 周四 | 8,832 | 0 |
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