title: Thread timeout in c#
body: <p>I'm new to threading in C#.
  Is there anyway of setting a timeout for a thread without blocking the calling thread (in C# 3.5)?</p>
  
  <p>If not, is it logical to execute a function using a thread and within that function create a thread and join it to overcome this main thread blocking issue? To illustrate:</p>
  
  <p>Instead of:</p>
  
  <pre><code>Public void main()
  {
          ...
          Thread thrd1 = new Thread(new ThreadStart(targetObj.targetFunc));
          thrd1.Start();
          thrd1.Join();
          ...
  }
  </code></pre>
  
  <p>Using something like:</p>
  
  <pre><code>Public void main()
  {
          ...
          Thread thrd1 = new Thread(new ThreadStart(middleObj.waiter));
          thrd1.Start();
          ...
  }
  
  //And in the middleObj.waiter():
  Public void waiter()
  {
          Thread thrd2 = new Thread(new ThreadStart(targetObj.targetFunc));
          thrd2.Start();
          thrd2.Join();
  }
  </code></pre>