title: Is rocksdb WriteBatch thread safe?
body: <p>For example, one class has a private db, and a public method-<code>put</code> .
  We got several threads to run the <code>put</code>, is this ok ? (ps: we don't consider the order of the k/v )</p>
  
  <pre><code>void put(List&lt;byte[] keys, List&lt;byte[]&gt; values) {
        WriteOptions writeOpt = new WriteOptions();
        WriteBatch batch = new WriteBatch();
        for (int i = 0; i &lt; keys.size(); ++i) {
          batch.put(keys.get(i), values.get(i));
        }
        this.db.write(writeOpt, batch);
  }
  </code></pre>
  
  <p>The <a href="https://github.com/facebook/rocksdb/wiki/Basic-Operations" rel="nofollow noreferrer">doc here</a> says that </p>
  
  <pre><code>However other objects (like Iterator and WriteBatch) may require external synchronization. 
  If two threads share such an object, they must protect access to it using their own locking protocol. 
  </code></pre>
  
  <p>But for the example above, the threads don't share the same <code>WriteBatch</code>, they own its own <code>WriteBatch</code>, and write to the db. So I wonder if this is ok?</p>