开发者

What is a thread pool in C++ and how it is implemented? [closed]

开发者 https://www.devze.com 2022-12-23 16:36 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

Improve this question 开发者_JS百科

I just came across a new term: thread pool. I don't know what it is, can any ody offer some information about this?

What it is a thread pool and how it is implemented?

Is a thread pool just a collection of threads?


ThreadPool is basically collection of threads. Whenever a task is assigned to the threadpool, the available thread accepts the task and executes it.

The advantages of thread pool is to control the threads creation\destruction and also, optimize the thread usage.

Thread Pool concept is not the C++ language feature. There are many custom implementation of thread Pool. ( Using different strategies).

You can also read

  • thread pool in .NET
  • The threadpool library

to know more.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号