IX.Guaranteed 1.0.0

dotnet add package IX.Guaranteed --version 1.0.0
                    
NuGet\Install-Package IX.Guaranteed -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IX.Guaranteed" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IX.Guaranteed" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="IX.Guaranteed" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IX.Guaranteed --version 1.0.0
                    
#r "nuget: IX.Guaranteed, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IX.Guaranteed@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IX.Guaranteed&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=IX.Guaranteed&version=1.0.0
                    
Install as a Cake Tool

IX.Guaranteed

A small .NET library providing simple thread-safe collection implementations.

Overview

IX.Guaranteed includes safe concurrent wrappers over common collection types:

  • ThreadSafeDictionary<TKey, TValue>
  • ThreadSafeList<T>
  • ThreadSafeQueue<T>
  • ThreadSafeStack<T>
  • ThreadSafeEnumerator<T>

Each collection synchronizes access so multiple readers can safely enumerate or inspect the data while writes are protected.

Features

  • ThreadSafeDictionary<TKey, TValue>

    • Implements IDictionary<TKey, TValue> and IDisposable
    • Supports thread-safe add, remove, contains, indexer access, and snapshots for Keys and Values
  • ThreadSafeList<T>

    • Implements IList<T> and IDisposable
    • Provides safe add, remove, insert, indexer access, enumeration, and clear operations
  • ThreadSafeQueue<T>

    • Implements IEnumerable<T> and IDisposable
    • Supports Enqueue, Dequeue, Peek, TryDequeue, TryPeek, and thread-safe enumeration
  • ThreadSafeStack<T>

    • Implements IEnumerable<T> and IDisposable
    • Supports Push, Pop, Peek, TryPop, TryPeek, ToArray, and thread-safe enumeration
  • ThreadSafeEnumerator<T>

    • Holds a read lock for the duration of enumeration
    • Used internally by the collection wrappers to safely iterate while protecting concurrent access

Usage

using IX.Guaranteed.Collections;

var list = new ThreadSafeList<int>();
list.Add(1);
list.Add(2);

foreach (var item in list)
{
    Console.WriteLine(item);
}

var queue = new ThreadSafeQueue<string>();
queue.Enqueue("first");
queue.Enqueue("second");

if (queue.TryDequeue(out var value))
{
    Console.WriteLine(value);
}

var dictionary = new ThreadSafeDictionary<string, int>();
dictionary["one"] = 1;

if (dictionary.TryGetValue("one", out var result))
{
    Console.WriteLine(result);
}

Notes

  • The collection implementations are designed to make common operations thread-safe using locks.
  • ThreadSafeList<T>, ThreadSafeDictionary<TKey, TValue>, ThreadSafeQueue<T>, and ThreadSafeStack<T> are disposable and should be disposed when no longer needed.
  • Enumeration is safe because ThreadSafeEnumerator<T> acquires a read lock for the lifetime of the enumeration.

Project

The library is intended as a lightweight, guaranteed thread-safe collection utility for .NET applications.

AI notice

The code in this project has been created with the use of local AI models. No cloud-based AI models have been used.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 93 6/29/2026
Loading failed