Skip to content

maoxing/ThreadPool

Repository files navigation

ThreadPool

A simple thread pool implemented in C++11, and depends on the moodycamel::ConcurrentQueue library

Usage samples

Basic usage

#include <iostream>
#include "ThreadPool.h"

int main()
{
    // create thread pool
    ThreadPool pool;

    //start pool
    pool.start();

    //dispatch one task
    pool.dispatchTask([]() { std::cout<< "Hello World" << std::endl; });

    //stop thread pool
    pool.stop();
    
    return 0;
}

About

A simple thread pool implemented in C++11.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages