title: Multi-Threaded Client-Server Web Service - Making server side data thread-safe
body: <p>I am implementing a multi-threaded web service. A thread is spawned per incoming request. For each client, a session is created and each session contains a data section - say a DOM tree. Client requests will basically be get/set methods and the server will read/write the DOM.</p>
  
  <p>So the DOM data is per client.</p>
  
  <p>Now my question is, should the server treat this DOM tree as a critical section?</p>
  
  <p>Basically the question is will there be a scenario where the server has two threads which are servicing the same client?</p>
  
  <p>The request/response are SOAP over tcp. As per my understanding, a tcp client cannot send simultaneous requests even if the client is multithreaded. So at the server side, I will not have a situation where two threads are for the same client. Please correct me if I am wrong, I am new to tcp/ip client-server programming.</p>
  
  <p>Thanks.</p>