thread-pool
thread-pool copied to clipboard
Thread pool implementation using c++11 threads
Is there a best way to solve this problem?
I found that `m_queue.size()` isn't equal to zero when `pool.shutdown()` was runned, so some tasks do not finish when the thread pool closes. I fixed it up as follows: ```cpp...
```cpp #include #include "../include/ThreadPool.h" class TEST { private: std::mutex mtx; std::vector v1[2]; std::priority_queue q; public: void init() { v1[0].push_back(1); v1[0].push_back(2); v1[0].push_back(3); v1[1].push_back(1); v1[1].push_back(3); v1[1].push_back(2); } void push(const int& index) {...
https://github.com/mtrebi/thread-pool/blob/dac6bddfc20346a31832ff11a654fd3d774428ca/include/ThreadPool.h#L27 Bool isn't atomic or use lock.
测试例程如下: class A { public: static int Afun(int n = 0) { std::cout
From: https://github.com/Fdhvdu/ThreadPool/tree/master/comparison > First, I will not compare nbsdx, philipphenkel, tghosgor and mtrebi. Because their works has potential bug. In the mtrebi test directory: https://github.com/Fdhvdu/ThreadPool/tree/master/comparison/mtrebi > **Warning** > Do not...
Let me first say that I'm a complete newbie to everything related to C++. I've tried compiling the example code on Windows using MinGW-w64. It compiles without throwing an error,...
cmake configure fails with the following error: ``` CMake Error at CMakeLists.txt:23 (add_executable): Cannot find source file: src/main.cpp Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm...
Hi, I assume the answer is "no" of course, but, before I make that conclusion, I would prefer asking in here :). Can I somehow have a member-method (non-static) be...