A variety of helpful collections, with a focus on thread-safety.
$ dotnet add package Velentr.Collections
A variety of helpful collections, with a focus on thread-safety.
The recommended installation approach is to use the available nuget package: Velentr.Collections
Alternatively, you can clone this repo and reference the Velentr.Collections project in your project.
| Collection | Description | Min Supported Library Version | Documentation |
|---|---|---|---|
| BiDirectionalDictionary | A dictionary where you can access the value for a given key, and the key for a given value | 1.2.0 | Documentation |
| DefaultDictionary | A dictionary that will return a default value if the key is not found. | 3.1.0 | Documentation |
| SizeLimitedList | A list that is limited in maximum capacity and will automatically remove items when it reaches capacity | 1.1.0 | Documentation |
| SizeLimitedDictionary | A dictionary that is limited in maximum capacity and will automatically remove items when it reaches capacity | 1.1.0 | Documentation |
| Pool | A pool of objects that can be used to hold objects and define a maximum amount. More efficient generally for games as it can help reduce garbage collection | 1.0.0 | Documentation |
| History | A collection that keeps track of the history of items added and removed from it. It can be used to track changes over time. | 1.0.0 | Documentation |
| ConcurrentPriorityQueue | A thread-safe priority queue where the item with the lowest priority is returned on dequeue | 1.0.0 | Documentation |
| ConcurrentPool | A thread-safe pool of objects that can be used to hold objects and define a maximum amount. More efficient generally for games as it can help reduce garbage collection | 1.0.0 | Documentation |
| ConcurrentSizeLimitedList | A thread-safe list that is limited in maximum capacity and automatically removes excess items when it is full | 1.0.0 | Documentation |
| LockFreePriorityQueue | A lock-free priority queue where the item with the lowest priority is returned on dequeue | 1.0.0 | Documentation |
| LockFreeList | A lock-free linked list implementation | 1.0.0 | Documentation |
| LockFreeQueue | A lock-free queue implementation | 1.0.0 | Documentation |
| LockFreeStack | A lock-free stack implementation | 1.0.0 | Documentation |
NOTES:
| Collection | Deprecation Reason | Deprecation Library Version | Max Available Library Version |
|---|---|---|---|
| DictionaryCache | Use .NET ImmutableDictionary instead. | 2.0.2 | 2.0.2 |
| OrderedDictionary | Use .NET OrderedDictionary instead. | 2.0.2 | 2.0.2 |
| SizeLimitedPool | Use Velentr.Collections.Pool instead. | 2.0.2 | 2.0.2 |
| HistoryCollection | Use Velentr.Collections.History instead. | 2.0.2 | 2.0.2 |
| LockFreePool | In need of heavy refactoring and testing. | 2.0.2 | 2.0.2 |
| LockFreeLimitedPriorityQueue | Use Velentr.Collections.LockFree.LockFreePriorityQueue instead. | 2.0.2 | 2.0.2 |
| ConcurrentLimitedPriorityQueue | Use Velentr.Collections.Concurrent.ConcurrentPriorityQueue instead. | 2.0.2 | 2.0.2 |
See list of issues under the Milestones: https://github.com/vonderborch/Velentr.Collections/milestones