66. What is a thread pool?

What is a thread pool?

  • Thread pool is a software design pattern. And it uses a collection of worker threads to execute asynchronous tasks. It helps save the resourece and improvement of program.
  • When a thread completes a task, it’ll return to thread pool and thread pool will assign it for another task. We must do that because opening and closing a thread take a lot of resuorce and it make program slower. We must take advantage of existing thread instead of creating a new one

Leave a Reply

Your email address will not be published. Required fields are marked *