ConcurrencyToolkit 0.2.1
dotnet add package ConcurrencyToolkit --version 0.2.1
NuGet\Install-Package ConcurrencyToolkit -Version 0.2.1
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="ConcurrencyToolkit" Version="0.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConcurrencyToolkit --version 0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ConcurrencyToolkit, 0.2.1"
#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.
// Install ConcurrencyToolkit as a Cake Addin #addin nuget:?package=ConcurrencyToolkit&version=0.2.1 // Install ConcurrencyToolkit as a Cake Tool #tool nuget:?package=ConcurrencyToolkit&version=0.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ConcurrencyToolkit
Concurrent collections and synchronization primitives for writing fast multithreaded and asynchronous code. This library is experimental and provided without warranty, so use it carefully.
Features
- lockless semaphores
- priority semaphore
- lockless object and array pools
- memory compact single writer multiple readers hash map
- memory compact thread safe (but locked) hash map
- write optimized lock-free counter
Types
ConcurrencyToolkit.Synchronization
QueueSemaphore
: usesConcurrentQueue
to order waitersStackSemaphore
: usesConcurrentStack
to order waitersSimpleSegmentSemaphore
: uses segment queue to order waiters (similar to the Semaphore from kotlinx.coroutines)SegmentSemaphore
: uses segment queue with support of early removal of cancelled waitersPrioritySemaphore
: lock-based semaphore (like SemaphoreSlim), but releases waiters in specified priority
ConcurrencyToolkit.Pooling
LocklessArrayPool<T>.Shared
: similar toArrayPool<T>.Shared
but uses bounded concurrent queue instead of lock protected arrays to store pooled items.IObjectPool<T>
,ObjectPool<T>
ConcurrencyToolkit.Collections
SingleWriterDictionary<TKey, TValue, TComparer>
: memory-compact hash map that supports single writer and multiple readers simultaneously. Writes are lock-free (except for resizes, which may trigger GC), but reads may be retried when a parallel update occurs.StripedDictionary<TKey, TValue, TComparer>
: memory-compact hash map, designed to avoidConcurrentDictionary
GC overhead. It is not general purposeConcurrentDictionary
replacement, and generally is slower, especially for reads.DefaultComparer<TKey>
: default comparer for ConcurrencyToolkit hash mapsComparerWrapper<TKey>
: struct wrapper over the reference type comparer
ConcurrencyToolkit.Metrics
ThreadSafeCounter64
: scalable atomic counter that distributes writes across per-core variables
ConcurrencyToolkit.Threading
InterlockedFloatingPoint
: methods for atomic floating point arithmeticsLowLatencySpinWait
:SpinWait
implementation that achieves low latency (~0.5ms) on sleeps instead of standard 15ms
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ConcurrencyToolkit:
Package | Downloads |
---|---|
w7rus.SerialPortWrapper
A serial port wrapper with asynchronous support via channels |
GitHub repositories
This package is not used by any popular GitHub repositories.