title: most efficient data storage object for queuing a max number of elements
body: <p>I need a storage type that I can set a max number of elements for and whenever I add something to the tail, the head is truncated as necessary with low overhead. I can of course do this manually if I have to. Example</p>
  
  <p>max = 1000</p>
  
  <p>fill it with integers 1-1000 : [1,2,...,999,1000]</p>
  
  <p>add numbers 1000 - 1500 : [500,501,....,1499,1500]</p>
  
  <p>It has to be as cheap an operation as possible since I will be running multiple threads at this time, one doing audio recording. I don't care about keeping the head elements as they are popped off, I would like to get rid of them in a bulk operation.</p>
  
  <p>I checked out the queue types in the SDK, not sure which could suit these needs, possibly a linked queue of some kind.</p>
  
  <p>Thanks for any help</p>