title: Using a non-thread-safe component with a multithread component (Design)
body: <h2>Design problem :</h2>
  
  <p>Using a <strong>non-thread-safe</strong> component (Collection, API, ...) in/with a <strong>multithread</strong> component ...</p>
  
  <h2>Example :</h2>
  
  <p><strong>component1</strong> : A multithread <strong>socket server</strong> who send messages ... to a message handler</p>
  
  <p><strong>component2</strong> : A non-thread-safe <strong>message handler</strong> who process messages ... from a server</p>
  
  <h2>My solution :</h2>
  
  <p>Adding a thread-safe component ( <strong>buffer</strong> ) between the server and the message handler, the buffer will receive messages in <strong>multithread</strong> manner from the server and send them in the <strong>same order</strong> to the message handler in a <strong>single thread</strong> manner.</p>
  
  <h2>My question :</h2>
  
  <p>Is there a better solution ? an appropriate design pattern may be <strong>proxy</strong> or <strong>pipeline</strong> ?</p>