title: pthread kill after a certain time duration
body: <p>I'm working with VS2005 C++ and I'm BRAND NEW to it.</p>
  
  <p>I have a loop that creates several threads using the following statement -</p>
  
  <pre><code>rc = pthread_create(&amp;thread[i], NULL, &amp;Function, (void *)threadID);
  </code></pre>
  
  <p>I want to terminate all threads after a certain duration (say 5 minutes). How do I have a timer that kills all threads after this duration?</p>