title: Is it safe to access (read) a bit from a bitset (C++) which may be modified by a different thread
body: <p>Is this type of operation considered safe? (in other words no chance of reading some bogus intermediate value if the bitset is being modified on a different thread)? Specifically I'm only interested in whether the read is safe, in other words, I am not asking whether it's safe to write to a bitset from two separate threads.</p>
  
  <p>eg: Will thread 1 reliably get the current state of bit 5 regardless of whether other bits in bs are being set/cleared at the same time?</p>
  
  <pre><code>std::bitset&lt;64&gt; bs;
  
  //thread 1:
  bool val;
  val=bs.test(5);
  // ...
  
  //thread 2:
  // set/clear a few bits
  bs.set(1);
  bs.set(3);
  bs.set(5);
  bs.reset(6);
  // ...
  </code></pre>