title: What happens to threads when exec() is called?
body: <p>I am taking an OS class and trying to wrap my head around this question, any help would be appreciated:</p>
  
  <blockquote>
    <p>What happens to the other threads, if one of many threads within a process makes an exec() call? Why?</p>
  </blockquote>
  
  <p>My understanding of exec() is that is replaces the current process with a new one, and it's main difference from fork() is that fork() creates a clone and you end up with duplicates.</p>
  
  <p>So if exec() replaces the current process, would it kill the threads of the old process and replace them with the new one?  Any help will be appreciated.</p>