文件名称:Threadpool:轻便,快速,适用于C ++ 20的线程池
文件大小:19KB
文件格式:ZIP
更新时间:2024-04-14 13:48:58
lock-free threadpool work-stealing cpp20 C++
riften::Thiefpool 面向C ++ 20的超快速,轻量级,可窃取工作的线程池。 建立在无锁并发 。 用法 # include " riften/thiefpool.hpp " // Create thread pool with 4 worker threads. riften::Thiefpool pool ( 4 ); // Enqueue and return future. auto result = pool.enqueue([]( int x) { return x; }, 42 ); // Get result from future. std::cout << result.get() << std::endl; 另外, riften::Thiefpool提供了分离的入队版本: // Enqueue and return nothing pool.enq
【文件预览】:
Threadpool-main
----benchmark()
--------CMakeLists.txt(737B)
--------bench.cpp(2KB)
----cmake()
--------CPM.cmake(845B)
----test()
--------thiefpool_test.cpp(5KB)
--------example_test.cpp(366B)
--------CMakeLists.txt(1KB)
----include()
--------riften()
----LICENSE(16KB)
----.clang-format(455B)
----.gitignore(331B)
----CMakeLists.txt(1KB)
----.cmake-format(1KB)
----README.md(1KB)