title: What are examples of non thread-safe code in Ruby?
body: <p>I'm looking at using <a href="http://sidekiq.org/" rel="nofollow">Sidekiq</a>, an asynchronous job processing queue written in Ruby which runs its jobs using threads.</p>
  
  <p>Due to MRI and GIL, developers tend to stay away from writing multi-threaded code in Ruby and that's why there isn't a whole lot written about thread-safe code in Ruby. </p>
  
  <p>Some common everyday patterns like <code>result ||= something.call</code> without a surrounding mutex is not thread safe. So my question is what are some other simple everyday Ruby code that's not thread safe?</p>