title: C++ new operator thread safety in linux and gcc 4
body: <p>Soon i'll start working on a parallel version of a mesh refinement algorithm using shared memory.</p>
  
  <p>A professor at the university pointed out that we have to be very careful about thread safety because neither the compiler nor the stl is thread aware.</p>
  
  <p>I searched for this question and the answer depended on the compiler (some try to be <em>somewhat</em> thread-aware) and the plattform (if the system calls used by the compiler are thread-safe or not).</p>
  
  <p>So, in linux, the gcc 4 compiler produces thread-safe code for the new operator?</p>
  
  <p>If not, what is the best way to overcome this <em>problem</em>? Maybe lock each call to the new operator?</p>