title: Thread safe Collection with upper bound
body: <p>I am after a collection with the following properties:</p>
  
  <ul>
  <li><strong>threadsafe</strong>: it will be used in asp.net and multiple clients could try to add, remove and access members concurrently</li>
  <li><strong>max elements</strong>: I want to be able to set an upper bound, a maximum number of elements, at construction time</li>
  <li><strong>TryAdd</strong>: a method that works the same as <code>BlockingCollection&lt;T&gt;.TryAdd(T)</code> would be perfect, i.e. it would return false if the maximum number of elements has been reached</li>
  <li><strong>Dictionary-like</strong>: In most other respects a <code>ConcurrentDictionary</code> would be perfect, i.e. ability to identify elements by a key, remove any item (not just the first or last, which I think would be the limitation with <code>BlockingCollection</code>)</li>
  </ul>
  
  <p>Before I attempt to roll my own, my questions are:</p>
  
  <ol>
  <li>have I missed a built in type that would put a safe ceiling on the number of elements in a collection?</li>
  <li>Is there a way to achieve this functionality with <code>BlockingCollection</code> somehow?</li>
  </ol>
  
  <p>Finally, if I do need to try and make my own, what approach should I think about?  Is it as simple as a wrapped <code>Dictionary</code> with <code>locks</code>?</p>
  
  <p><strong>Example use:</strong>
  A chat room with a defined limit on number of participants could store the connection information of participants and reject new entrants until there is room to enter when full</p>