문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top