Here's the simplest possible code for creating a custom collection class in the Microsoft .NET Framework that includes support for For…Each loops, an indexer method and initializing collections with { ...
The ConcurrentStack and ConcurrentQueue classes, lock-free and thread-safe implementations of the Stack and Queue classes, build thread safe collections in .Net Thread safe collections were first ...