title: How to "multithread" C code
body: <p>I have a number crunching application written in C. It is kind of a main loop that for each value calls, for increasing values of "i", a function that performs some calculations. I read about multithreading, and I am considering learning a bit about it, in C. I wonder if somehow general code like mine could be automatically multithreaded and how.</p>
  
  <p>Thanks</p>
  
  <p>P.D. To get an idea about my code, let's say that it is something like this:</p>
  
  <pre><code>main(...)
  for(i=0;i&lt;=ntimes;i++)get_result(x[i],y[i],result[i]);
  </code></pre>
  
  <p>...</p>
  
  <pre><code>void get_result(float x,float y,float result){
    result=sqrt(log (x) + log (y) + cos (exp (x + y));
  (and some more similar mathematical operations)
  }
  </code></pre>