title: overhead of std::list in C++, what is the solution?
body: <p>I have this code like this:</p>
  
  <pre><code>uint16_t getNextAvailableTransactionID() throw (RMAPEngineException) {
      transactionIDMutex.lock();
      if (availableTransactionIDList.size() != 0) {
          unsigned int tid = *(availableTransactionIDList.begin());
          availableTransactionIDList.pop_front();
          transactionIDMutex.unlock();
          return tid;
      } else {
          transactionIDMutex.unlock();
          throw RMAPEngineException(RMAPEngineException::TooManyConcurrentTransactions);
      }
  }
  </code></pre>
  
  <p>and the availableTransactionIDList is a std::list of C++</p>
  
  <p>Because I use this function as a part in reading out data from hardware. After checking, the overhead coming from the the availableTransactionIDList (I used a clock_gettime() and make a timestamp in the functions to check).</p>
  
  <p>Just wondering, is there anyway to solve the problem with overhead of std::list ?</p>