Is there any way (apart form actual perfomance measurements which can be pretty hard to make them realistic) or rule of thumb when I should stop using the ThreadPool
and use a dedicated Thread
instead? I suppose for long running work it is better to use a dedicated Thread
because it doesn't peramently steal one from the ThreadPool
. For shorter work it is better use the the ThreadPool
because creating threads and the thread itself consumes a lot of resources.
But where is the magic barrier? How do I decide which approach to use?
In simple applications it might not matter that much. But I am dealing with a custom .NET-based application framework where a single application can have a lot of plugins which in most cases need to do some work asynchonously. And I am thinking about introducing a policy for the plugin authors when to use which.