Skip to content

ch2ohch2oh/ThreadPool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThreadPool

A simple C++11 Thread Pool implementation.

Basic usage:

// 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;

Example: Running with command line arguments

Build the example:

cmake -B build
cmake --build build

Run with custom thread and task counts:

./build/example --threads 8 --tasks 8

About

A simple C++11 Thread Pool implementation

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 87.3%
  • CMake 6.6%
  • Makefile 6.1%