You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto future = async(launch::async, [](unique_ptr<tcp::socket> socket) -> bool {
In this part of the code it is totally unnecessary to using async as we create a future and right after block for that future. I think it was part of the code that was written very fast. We will get back to it later
auto future = async(launch::async, [](unique_ptr<tcp::socket> socket) -> bool {
For this part yes thread pool is a great idea indeed, maybe you can submit a PR with the thread pool. Still it might make the code more complicating only adding some slightly performance improvement. Maybe you can suggest an easy way of implement thread pool.
When calling
std::async
, it creates new thread. Better having thread pool and enqueue to it functions and lambdas with return ofstd::future
.The text was updated successfully, but these errors were encountered: