We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e8ad09 commit f659749Copy full SHA for f659749
README.md
@@ -3,5 +3,15 @@ ThreadPool
3
4
A simple C++11 Thread Pool implementation.
5
6
-The "legacy" directory contains a version that does not use std::future
7
-but a custom Result<T> type that has essentially the same functionalty.
+Basic usage:
+```c++
8
+// create thread pool with 4 worker threads
9
+ThreadPool pool(4);
10
+
11
+// enqueue and store future
12
+auto result = pool.enqueue([](int answer) { return answer; }, 42);
13
14
+// get result from future
15
+std::cout << result.get() << std::endl;
16
17
+```
0 commit comments