I developed a .net application using the .net framework 4.0, where I used the parallel.for () loop for multithreading. I used the following configuration:
- Windows 7
- IIS 7.0
- Framework v4.0.30319
I used the ParallelOptions () class, and the MaxDegreeOfParallelism property of this class is set to 5. I registered the Thread.CurrentThread.ManagedThreadId file in the log file to check if 5 threads were created at runtime. I tested this application in two different environments. When the application runs in the environment where it was developed, 5 stream identifiers are created. But while it works in a different environment, it creates 6 or 7 thread identifiers. The application is compiled only in the 1st environment. I used the published version of the application for testing in the second environment. Can someone help me by telling why this is happening and how to solve it?
source share