title: Difference between OpenMP threadprivate and private
body: <p>I am trying to parallelize a C program using OpenMP.</p>
  
  <p>I would like to know more about:</p>
  
  <ol>
  <li>The differences between the <strong>threadprivate</strong> directive and the <strong>private</strong> clause and </li>
  <li>In which cases we must use any of them. </li>
  </ol>
  
  <p>As far as I know, the difference is the global scope with <strong>threadprivate</strong> and the preserved value across parallel regions. I found in several examples that when a piece of code contains some global/static variables that must be privatized, these variables are included in a <strong>threadprivate</strong> list and their initial values are copied into the private copies using <strong>copyin</strong>. </p>
  
  <p>However, is there any rule that prevents us to use the <strong>private</strong> clause to deal with global/static variables? perhaps any implementation detail?</p>
  
  <p>I couldn't find any explanation in the OpenMP3.0 specification.</p>