I've heard that there is a number of threads in an application which used be used to get the best performances. I've heard that when the number of thread are increased, the performances will increase until one point and after that it will start to decrease. And for android application that limit is like 3 or 4.
Can someone explain this inside out ?
Currently I'm working on a C# standalone application and in there I've used about 50 background workers. How this affect to the performances of the system ?
As mentioned before, there is no definitive answer to this but i might as well share a bit of experience here. If you're working on a standalone client application it's usually a good idea to have one thread for core functionality and the user interface and separate threads to perform things like prime factorization. The point of this is to keep the UI responsive even if your background worker is really busy crunching numbers.
Beyond that it might be a good idea to assign tasks to new threads, so that you can manage them properly but i'd suggest this only if there are a lot of different tasks to keep track of and you already know that some of those threads could run into infinite loops or that you want a way to shut them down without halting the whole application.
to get started with the theoretical side of things you might want to check out: Amdahl's Law
best regards, garglblarg :>