title: Is C++ STL thread-safe for distinct containers (using STLport implementation)?
body: <p>I'm using Android 2.2, which comes with a version of STLport.  For some reason, it was configured to be non-thread safe.  This was done using a #define _NOTHREADS in a configuration header file.</p>
  
  <p>When I constructed and initialized <strong>distinct</strong> non-shared containers (e.g. strings) from different pthreads, I was getting memory corruption.</p>
  
  <p>With _NOTHREADS, it looks like some low-level code in STL inside allocator.cpp doesn't do proper locking.  It seems analogous to C not providing thread safety for malloc. </p>
  
  <p>Does anyone know why STL might be built with _NOTHREADS by default on Android?  By turning this off, I'm wondering if there may be a side effect.  One thing I can think of is slightly degraded performance, but I don't see much of a choice given I'm using lots of threading.</p>