title: Why does this threading code not terminate?
body: <p>I'm experimenting with Threading and Exceptions under C# .Net 4.5 and i somehow created an infinite loop without using for, while, do-while or recursion. If I excute/debug this code in Visual Studio, VS is stopping at every Exception (I keep hitting Continue).</p>
  
  <pre><code>static void Main(string[] args)
  {
      AppDomain.CurrentDomain.UnhandledException += unhandledException;
      new Thread(new ThreadStart(() =&gt; { throw new Exception("Thread.Start (ThreadID: " + Thread.CurrentThread.ManagedThreadId + ")"); })).Start();
      ThreadPool.QueueUserWorkItem(new WaitCallback(_ =&gt; { throw new Exception("ThreadPool.QueueUserWorkItem (ThreadId: " + Thread.CurrentThread.ManagedThreadId + ")"); }));
      Task.Run(() =&gt; { throw new Exception("Task.Run (" + Thread.CurrentThread.ManagedThreadId + ")"); });
  
      if (Debugger.IsAttached) Console.ReadLine();
  }
  
  private static void unhandledException(object sender, UnhandledExceptionEventArgs e)
  {
      Console.WriteLine("Unhandeled {0}:\t{1}", e.ExceptionObject.GetType().Name, (e.ExceptionObject as Exception).Message);
  }
  </code></pre>
  
  <p>When I run this application without VS, Windows terminates the program because it’s not responding.<br>
  So, what’s going on here? Why do this exceptions not appear only once?</p>