I have been using Parallel.ForEach to fetch & process data concurrently. Collection which is used in Parallel.ForEach has more than 100 elements. If i don't restrict number of thread created in parallel then creating SqlConnection out of Connection Pool throwing an exception of exceeding the limit of connection pool.
Now i want to set maxdegreeofparallelism to restrict connections being created at any moment.Production Server might have hyperthreading support .If hyperthreading is supported by system then is it advisable to set No of LOGICAL cores instead of PHYSICAL cores into maxdegreeofparallelism.
So, should I use the setting for # LOGICAL cores or PHYSICAL cores?