Concurrent Priority Queue in .NET 4.0

前端 未结 9 850
攒了一身酷
攒了一身酷 2020-12-09 02:32

It seems there are lots of improvements in .NET 4.0 related to concurrency that might rely on concurrent priority queues. Is there decent priority queue implementation insid

9条回答
  •  醉话见心
    2020-12-09 03:00

    Well, 7 years passed, but for posterity, I would like to answer with my implementation.

    Documentation: Optionally awaitable simple to use Concurrent Priority Queue

    Sourcecodes: github

    nuget package

    • Lock-Free,
    • Highly Concurrent,
    • generic in stored item type,
    • generic in priority type, but constrained to priorities represented by .net enum, strongly typed priority,
    • explicitly defined descending order of priorities during construction,
    • ability to detect items count and per priority level items count,
    • ability to dequeue - descending order of priorities,
    • ability to override dequeue priority level,
    • potentially awaitable,
    • potentially priority based awaitable,

提交回复
热议问题