Advantage of using Thread.Start vs QueueUserWorkItem

后端 未结 9 1629
有刺的猬
有刺的猬 2020-11-28 12:49

In multithreaded .NET programming, what are the decision criteria for using ThreadPool.QueueUserWorkItem versus starting my own thread via new Thread() and Thread.Start()?

9条回答
  •  天涯浪人
    2020-11-28 13:18

    One advantage of using Thread.Start() is, that you are able to intentionally abort the thread later. In the ThreadPool you have no means of controlling the thread execution after you enqueued it.

提交回复
热议问题