title: how to know what is NOT thread-safe in ruby?
body: <p><a href="http://edgeguides.rubyonrails.org/4_0_release_notes.html#railties-notable-changes" rel="noreferrer">starting from Rails 4</a>, everything would have to run in threaded environment by default. What this means is all of the code we write <strong>AND</strong> <strong>ALL</strong> the gems we use are required to be <code>threadsafe</code></p>
  
  <p>so, I have few questions on this:</p>
  
  <ol>
  <li>what is NOT thread-safe in ruby/rails? <strong>Vs</strong> What is thread-safe in ruby/rails?</li>
  <li>Is there a list of gems that <em>is</em> known to be threadsafe or vice-versa?</li>
  <li>is there List of common patterns of code which are NOT threadsafe example <code>@result ||= some_method</code>?</li>
  <li>Are the data structures in ruby lang core such as <code>Hash</code> etc threadsafe?</li>
  <li>On MRI, where there a <a href="http://en.wikipedia.org/wiki/Global_Interpreter_Lock" rel="noreferrer"><code>GVL</code>/<code>GIL</code></a> which means only 1 ruby thread can run at a time except for <code>IO</code>, does the threadsafe change effect us? </li>
  </ol>