Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 460 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 460 Bytes

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