title: Is SerializedSubject necessary for thread-safety in RxJava
body: <p>I created a <code>Subject</code> instance in RxJava and call its <code>onNext()</code> from multiple threads:</p>
  
  <pre><code>PublishSubject&lt;String&gt; subject = PublishSubject.create();
  //...
  subject.onNext("A");  //thread A
  subject.onNext("B");  //thread B
  </code></pre>
  
  <p>The <a href="https://github.com/ReactiveX/RxJava/wiki/Subject" rel="noreferrer">RxJava documentation</a> says that:</p>
  
  <blockquote>
    <p>take care not to call its <code>onNext( )</code> method (or its other on methods) from multiple threads, as this could lead to non-serialized calls, which violates the Observable contract and creates an ambiguity in the resulting <code>Subject</code>.</p>
  </blockquote>
  
  <ul>
  <li>Do I have to call <code>toSerialized()</code> on such <code>Subject</code> assuming I don't care if <code>"A"</code> goes before or after <code>"B"</code>? How would serialization help?</li>
  <li>Is <code>Subject</code> thread-safe anyway or will I break RxJava without <code>toSerialized()</code>?</li>
  <li>What is the "<em>Observable contract</em>" that the documentation mentions?</li>
  </ul>