ThreadPool icon indicating copy to clipboard operation
ThreadPool copied to clipboard

A simple C++11 Thread Pool implementation

Results 62 ThreadPool issues
Sort by recently updated
recently updated
newest added

Dear developer: I want to add `shutdown` function that waits until all worker finish. Because I found ThreadPool will deconstructing directly if process exit. I think user have right to...

How can i do this? ``` class A { public: void a(){ ThreadPool pool(4); pool.enqueue(b); } private: void b(){ num++; } int num; } ``` What i see is :`No...

The threads count is fixed after initialization. For example, if the thread count is 4 and the first 4 threads all need much time to finish. Now, the fifth thread...

It's very nice. Can it run without the call to std::make_shared to avoid a memory allocation?

I have tried compiling and running this program on a Windows system and it worked fine. When I try to compile and run on a Linux system, it compiles fine,...

result_of and its helper type result_of_t are deprecated as of C++17

``` #include "ThreadPool.h" #include class Foo { public: Foo(); void Process(std::unique_ptr im); private: void ProcessImpl(std::unique_ptr im); ThreadPool t; }; Foo::Foo() : t(4) { } void Foo::Process(std::unique_ptr im) { #if 0...

These two places do not serve as locks. You should use std:: lock_ guard

https://gitee.com/xiatian_wzh/CThreadPool