I have a specific query about threads created for console application. I created a simple c# console application which just prints Hello World. In the taskmanager for this application's process the number of threads shown are 10. I can think of 2 threads : one for writing to console and one for Garbage Collection. what about the other 8 threads ? Also is the number of threads created depends on the machine configuration or .net framework version ?
Asked
Active
Viewed 65 times
4
-
I get ~10 when running in Visual Studio but only ~4 when running the .exe directly, in case that adds any insight. – Rawling Feb 07 '13 at 14:44
-
2http://stackoverflow.com/questions/762316/why-3-threads-for-a-basic-single-threaded-c-sharp-console-app – spender Feb 07 '13 at 14:45
-
Don't forget the debugger, the JIT compiler, etc. etc. – Nolonar Feb 07 '13 at 14:46
-
This is a duplicate but cant find the original right now. Try having a look for similar question on StackOverflow. – Ash Burlaczenko Feb 07 '13 at 14:47
-
@spender but can we always pinpoint the exact number of threads taking into account no. of cores, .net framework version, 32bit/64bit machine or any other configuration parameters ? – Nitin Feb 07 '13 at 14:54