Contents tagged with Producer Consumer

  • Concurent collections of C#

    Hello everybody,

    today I want to write few words about Concurent collections in C#. First of all  I want to point there there are only four of them:

    ConcurrentDictionary

    ConcurrentQueue

    ConcurrentStack

    ConcurrentBag

    BlockingCollection

    Partitioner

    EnumerablePartitionerOptions

    IProducerConsumerCollection

    OrderablePartitioner

    Not very impressive set of collections if to compare with diversity of other collections in .Net.

    Also keep in mind that ConcurrentQueue, ConcurrentStack and ConcurrentBag are not suitable for a lot of purposes. For example those last three do not allow direct access to any element in the collection which makes them unfitting for many goals. In practical … more