Thread vs ThreadPool

后端 未结 11 2291
鱼传尺愫
鱼传尺愫 2020-11-22 15:57

What is the difference between using a new thread and using a thread from the thread pool? What performance benefits are there and why should I consider using a thread from

11条回答
  •  一个人的身影
    2020-11-22 16:32

    Thread local storage is not a good idea with thread pools. It gives threads an "identity"; not all threads are equal anymore. Now thread pools are especially useful if you just need a bunch of identical threads, ready to do your work without creation overhead.

提交回复
热议问题