At times I have seen posts about some using multiple threads in their apps, sometimes in the dozens of threads.
I have commented on this before saying that one must be very careful to not use too many threads. Some may take this with a "grain of salt", but I finally found this warning in writing in the API docs which verifies this is a concern.
Read the short topic on MSDN API docs:
Notice the sentence:
A simple statement, but worth remembering.
So before using dozens of threads in your apps thinking "if one thread is good" then "many threads must be great", reconsider your approach.
Now if the use of too many threads can slow performance, it is also reasonable to conclude that too many unnecessary context switches between threads can also degrade performance. This is why one book I use a reference on using threadsm suggest keeping all GUI calls in the main thread (that means all DDT GUI commands and things like SendMessage calls). SendMessage from a thread forces a context switch to the thread (or primary thread) which created the window.
So if you want the best performance possible, keep worker threads to a minimum.
I have commented on this before saying that one must be very careful to not use too many threads. Some may take this with a "grain of salt", but I finally found this warning in writing in the API docs which verifies this is a concern.
Read the short topic on MSDN API docs:
Notice the sentence:
However, you must use caution when using multiple threads in an application, because system performance can decrease if there are too many threads.
So before using dozens of threads in your apps thinking "if one thread is good" then "many threads must be great", reconsider your approach.
Now if the use of too many threads can slow performance, it is also reasonable to conclude that too many unnecessary context switches between threads can also degrade performance. This is why one book I use a reference on using threadsm suggest keeping all GUI calls in the main thread (that means all DDT GUI commands and things like SendMessage calls). SendMessage from a thread forces a context switch to the thread (or primary thread) which created the window.
So if you want the best performance possible, keep worker threads to a minimum.
Comment