0

I work on a multi-threaded application. And while debugging i have seen many instances where apart form the main thread and the threads my program creates, a lot more worker threads are created automatically. So i made a small program below with just main class and some few classes that just has a simple function to print out class name. I debug this and there is the same behavior. For a simple program the thread window shows a lot of threads have been spawned.

I read that some threads may be created for garbage collection and that same thread may run in different cores after context switching but i still can't figure out why so many other worker threads are created that neither has no name or code block associated with it.

Can anyone put some insight into this.

Simple Program Spawning multiple threads

PrajwolCE
  • 53
  • 6
  • 1
    Some of these are debugger threads, for example the vshost thing. Run this in Release mode without debugger attached, then attach it later. Make the first line of main Debugger.Break(); – usr Jul 23 '15 at 11:51
  • Thanks @rene Wonder how google search missed that! – PrajwolCE Jul 23 '15 at 12:36

0 Answers0