title: Effect of calling Functions in c++ dll from multiple threads
body: <p>I have a C++ Protocol Stack dll(for serial communication) which exposes a class to a front application. Exposed class is like as shown below:</p>
  
  <pre><code>class ProtocolStack
  {
  public :
      void OpenRequest(Params);
      void SendData(Params);
      void CloseRequest(Params);
  };
  </code></pre>
  
  <p>ProtocolStack Class creates different layers like PhysicalLayer as shown below.</p>
  
  <pre><code>class PhysicalLayer
  {
  private:
      int Baud_rate;
      string PortName;
  public:
      void Send(string);
      void Receive();
   };
  </code></pre>
  
  <p>I want to use the same protocol stack for reading data parallely from different systems.
  If i create a single object of Protocol Stack for parallel reading (from different ports) , when same function is called simultaneously from different threads will data segment allocated for each function call will be different?</p>
  
  <p>It will corrupt the private variables of Physical Layer. right?</p>
  
  <p>Do i need to maintain all data of each channel(parallel connection ) in each Layer?</p>
  
  <p>I want to process data parallely . Is there any other way apart from creating another object of stack or maintaining all data related to connection in each layer?</p>