I just started to work with threads and quickly I came to the very common question of how many threads are too many?
After doing some research I got even further confused.
task
I have 16 cores and a application generating 1000 objects, being despite from construction parameters consistent. Creating 1000 threads would usually create a huge overhead destroying the performance advantage from multithreading according to msdn documentation and Maximum number of threads. Also I must stay within the 3.5 NET 32 bit limit (Maximum number of threads in a .NET app?).
Question 1
Having such a unilateral task, is it possible to create more threads than cores on the computer? Is .NET optimizing something in there? What is the maximum number of threads I should use?
Question 2
Is there a simple beautiful solution, other then queueing it with limit resources? Something like a semaphore where I create all the 1000 threads but immediately inactivating the threads in order to not allocate the default thread stack?