thread pool

Threadpool in C++ is basically a pool having a fixed number of threads used when we want to work multiple tasks together (run multiple threads concurrently). This thread sits idle in the thread pool when there are no tasks and when a task arrives, it is sent to the thread pool and gets assigned to the thread. Pending tasks will remain in the queue waiting for a thread to get free. In C++ there is no specific library for thread pool, but it provides various methods in the API which the programmer can use and create the one according to the requirements.