title: c++ Handling queue overflow
body: <p>I am creating a thread which puts data into the message queue which is defined as follows:</p>
  
  <pre><code>std::deque&lt;struct MessageDetails&gt; MsgQueue;
  
  struct MessageDetails{
      char msg[256];
      uint64_t Signature;
      int32_t Id;
      int32_t Mask;
      bool Valid;
  };
  </code></pre>
  
  <p>Ideally the other module should <code>pop</code> the data from this queue and process it.
  But for error handling in my code , In case the other module is not processing any data (or not processing too quickly) then the message queue size keeps on increasing and may be at some point of time lead to overflow.</p>
  
  <p>I wanted know when will it overflow(what is the allocated size?) and how can I handle that? Is there any error that I can capture?</p>