title: Does Debug.Writeline in VB.NET stop thread execution?
body: <p>I have a VB.NET application that uses threads to asynchronously process some tasks in a "Scheduled Task" (console application).</p>
  
  <p>We are limiting this application to run 10 threads at once, like so:</p>
  
  <p>(pseudo-code)
   - Create a generic list of 10 threads
   - Spawn off the threadproc for each one
   - Do a <code>thread.join</code> statement for each thread to wait for the longest running one to complete.</p>
  
  <p>I am finding that if the code called by the threadproc contains any "Debug.Writeline" or "Trace.Traceinformation" statements, the thread hangs.  I can see the thread in the Debug - Windows - Threads window and switch to it, but it highlights the Debug.Writeline statement and never gets past it.</p>
  
  <p>Is there something special about the Debug or Trace statements that make them non-thread-safe?</p>
  
  <p>Why would this hang things up? If I leave the debug statement in, the thread never completes. If I take the debug statement out, the thread completes in less than 5 seconds.</p>