Closed regomne closed 5 years ago
When I enqueue some task:
for (int i = 0; i < 10000; i++) { pool.enqueue_task([i] { cout << i << endl; }); }
After all the task ENDED:
The std::packaged_task don't seem to be released, and they will be released after ThreadPool destructed. The same to queue.
The queue keeps the storage but the tasks themselves get destroyed after they are done.
Thanks, I replaced queue with deque and use its shrink_to_fit to reduce memory .
When I enqueue some task:
After all the task ENDED:
The std::packaged_task don't seem to be released, and they will be released after ThreadPool destructed. The same to queue.