title: Can I separate Python set update into several threads?
body: <p>I'm doing some brute-force computing and putting the results into a set <code>all_data</code>. Computing chunks of data gives a list of numbers <code>new_data</code>, which I want to add to the big set: <code>all_data.update(new_data)</code>. Now while the computational part is easily made parallel by means of <code>multiprocessing.Pool.map</code>, the update part is slow.</p>
  
  <p>Obviously, there is a problem if one has two identical elements in <code>new_data</code>, that are absent in <code>all_data</code>, and trying to add them at the same moment. But if we assume <code>new_data</code> to be a set as well, is there still a problem? The only problem I can see is the way sets are organized in memory, so the question is:</p>
  
  <blockquote>
    <p>Is there a way to organize a set structure that allows simultaneous addition of elements? If yes, is it realized in Python?</p>
  </blockquote>