Skip to content

Warchant/thread-pool-cpp

 
 

Repository files navigation

thread-pool-cpp

Build Status MIT licensed

  • It is highly scalable and fast.
  • It is header only.
  • No external dependencies, only standard library needed.
  • It implements both work-stealing and work-distribution balancing startegies.
  • It implements cooperative scheduling strategy.

Example run: Post job to thread pool is much faster than for boost::asio based thread pool.

Benchmark job reposting
***thread pool cpp***
reposted 1000001 in 61.6754 ms
reposted 1000001 in 62.0187 ms
reposted 1000001 in 62.8785 ms
reposted 1000001 in 70.2714 ms
***asio thread pool***
reposted 1000001 in 1381.58 ms
reposted 1000001 in 1390.35 ms
reposted 1000001 in 1391.84 ms
reposted 1000001 in 1393.19 ms

See benchmark/benchmark.cpp for benchmark code.

All code except MPMCBoundedQueue is under MIT license.

Build instructions

This thread pool can be build for:

  • linux
    • g++-5 and higher
    • clang-4 and higher
  • mac os
    • g++
    • clang
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DINSTALL=ON -DBENCHMARK=ON -DCOVERAGE=OFF
make

About

High performance C++14 thread pool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 88.4%
  • CMake 11.6%