Skip to content

Darky-Lucera/thread_pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThreadPool

This is a C++11 port based on the fast thread pool from Martin Vorbrodt.

From his great blog posts:

How to use

Just drop src/threadpool to your project

Example

thread_pool         pool;

auto work = [](const char *name) {
    printf("Hello %s!\n", name);
};

auto task = [](int a, int b) {
    return a + b;
};

pool.enqueue_work(work, "work");
auto result = pool.enqueue_task(task, 2, 3);
printf("Result: %d\n", result.get());

Note that work is 5-10x faster than task.

About

Fast C++11 thread pool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published