Meziantou.Framework.Threading 3.1.6

Prefix Reserved
dotnet add package Meziantou.Framework.Threading --version 3.1.6
                    
NuGet\Install-Package Meziantou.Framework.Threading -Version 3.1.6
                    
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="Meziantou.Framework.Threading" Version="3.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.Threading" Version="3.1.6" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.Threading" />
                    
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 Meziantou.Framework.Threading --version 3.1.6
                    
#r "nuget: Meziantou.Framework.Threading, 3.1.6"
                    
#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 Meziantou.Framework.Threading@3.1.6
                    
#: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=Meziantou.Framework.Threading&version=3.1.6
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.Threading&version=3.1.6
                    
Install as a Cake Tool

Meziantou.Framework.Threading

Provides types such as

  • ConcurrentHashSet<T>
  • ConcurrentObservableCollection<T>
  • SynchronizedList<T>
  • AsyncAutoResetEvent
  • AsyncLock
  • ResettableCancellationTokenSource
  • KeyedLock
  • KeyedAsyncLock

Provides extensions methods for

  • SemaphoreSlim
  • Task

Simplifying task awaiting (blog post)

var (a, b) = await (task1, task2);
var (a, b) = await (task1, task2).ConfigureAwait(false);

Thread-safe collection that can be bound to a UI control

using Meziantou.Framework.Collections.Concurrent;

// Created on the UI thread, so the notifications are raised on that thread
var collection = new ConcurrentObservableCollection<string>();
listBox.ItemsSource = collection.AsObservable;

// The collection itself is safe to use from any thread
await Task.Run(() => collection.Add("Item from a background thread"));

The thread the notifications are raised on can also be set explicitly:

var collection = new ConcurrentObservableCollection<string>(synchronizationContext);
Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Meziantou.Framework.Threading:

Package Downloads
ANcpLua.Roslyn.Utilities.Testing

Fluent testing framework for Roslyn analyzers, code fixes, and incremental generators with caching validation, forbidden type detection, and comprehensive assertion support.

ANcpLua.Roslyn.Utilities.Testing.MSBuild

Framework-independent project, process, and MSBuild test helpers.

ANcpLua.Roslyn.Utilities.Testing.Xunit

Opt-in Xunit integrations for ANcpLua Roslyn testing utilities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.6 899 9/27/2026
3.1.5 473 9/20/2026
3.1.4 302 9/13/2026
3.1.3 247 9/11/2026
3.1.2 439 9/6/2026
3.1.1 456 9/3/2026
3.1.0 1,122 8/20/2026
3.0.0 3,596 7/5/2026
2.0.10 302 7/5/2026
2.0.9 973 6/13/2026
2.0.8 280 6/7/2026
2.0.7 3,074 5/31/2026
2.0.6 517 5/23/2026
2.0.5 4,938 4/25/2026
2.0.4 21,088 1/18/2026
2.0.3 11,355 11/2/2025
2.0.2 6,570 9/3/2025
2.0.1 6,398 8/17/2025
2.0.0 10,201 4/27/2025
1.0.0 15,037 11/21/2024