Question

My app is using TaskFactory to do its work . If the user wants some instances of my app to start, when they log on, they put it as an startup entry. To avoid this I wish to make a service which will spawn multiple threads, which will do the same work as my app. Because TaskFactory uses ThreadPool and there is only one thread pool per app instsnce, will that affect my performance?

Was it helpful?

Solution

No, it's unlikely you'd see any performance hits. The ThreadPool starts with many available threads. Unless you're using more threads than available in the thread pool (which suggests you need a different architecture anyways), you should be fine.

Keep in mind that more threads does not necessarily mean better performance. If you have a 4 core CPU, your max throughput is 4 threads. (And even then, that's if no other apps are using those cores.) Throwing more threads at the problem from that point will not improve the performance of your app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top