![]() |
VOOZH | about |
dotnet add package Soenneker.Queues.Intrusive.ValueMpsc --version 4.0.24
NuGet\Install-Package Soenneker.Queues.Intrusive.ValueMpsc -Version 4.0.24
<PackageReference Include="Soenneker.Queues.Intrusive.ValueMpsc" Version="4.0.24" />
<PackageVersion Include="Soenneker.Queues.Intrusive.ValueMpsc" Version="4.0.24" />Directory.Packages.props
<PackageReference Include="Soenneker.Queues.Intrusive.ValueMpsc" />Project file
paket add Soenneker.Queues.Intrusive.ValueMpsc --version 4.0.24
#r "nuget: Soenneker.Queues.Intrusive.ValueMpsc, 4.0.24"
#:package Soenneker.Queues.Intrusive.ValueMpsc@4.0.24
#addin nuget:?package=Soenneker.Queues.Intrusive.ValueMpsc&version=4.0.24Install as a Cake Addin
#tool nuget:?package=Soenneker.Queues.Intrusive.ValueMpsc&version=4.0.24Install as a Cake Tool
π alternate text is missing from this package README image
π alternate text is missing from this package README image
π alternate text is missing from this package README image
π alternate text is missing from this package README image
dotnet add package Soenneker.Queues.Intrusive.ValueMpsc
ValueIntrusiveMpscQueue<TNode> is a multi-producer / single-consumer (MPSC) queue built around a classic intrusive algorithm with a permanent sentinel (βstubβ) node.
This value variant is designed to minimize indirection and memory traffic by storing queue state directly in value fields rather than reference wrappers.
Key characteristics:
This makes it especially suitable for hot paths in low-level concurrency primitives.
Compared to reference-based implementations, this variant:
If you are building performance-critical infrastructure (locks, schedulers, wait queues), this version is usually the right default.
Nodes must implement IIntrusiveNode<TNode> or derive from IntrusiveNode<TNode>.
public sealed class WorkItem : IntrusiveNode<WorkItem>
{
public int Id;
}
Each node carries its own linkage; the queue never allocates or wraps nodes.
var stub = new WorkItem();
var queue = new ValueIntrusiveMpscQueue<WorkItem>(stub);
The stub node must remain alive for the entire lifetime of the queue.
queue.Enqueue(new WorkItem { Id = 42 });
This operation is lock-free and safe to call concurrently from multiple threads.
if (queue.TryDequeue(out var item))
{
// process item
}
If stronger dequeue guarantees are required (for example, when a producer has advanced the tail but not yet published the link), use:
queue.TryDequeueSpin(out var item);
This type intentionally enforces strict usage rules:
TryDequeue may return false while a producer is mid-enqueue β this is expected.Violating these constraints will result in undefined behavior.
This is a low-level primitive, not a general-purpose collection.
This queue is a good fit when:
If you need a general-purpose queue with multiple consumers, prefer ConcurrentQueue<T> or System.Threading.Channels.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Soenneker.Queues.Intrusive.ValueMpsc:
| Package | Downloads |
|---|---|
|
Soenneker.Asyncs.Locks
The fastest .NET async lock. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.24 | 0 | 6/18/2026 |
| 4.0.23 | 130,026 | 6/5/2026 |
| 4.0.22 | 98 | 6/5/2026 |
| 4.0.21 | 96 | 6/5/2026 |
| 4.0.20 | 267,690 | 4/23/2026 |
| 4.0.19 | 5,193 | 4/23/2026 |
| 4.0.18 | 233,996 | 3/13/2026 |
| 4.0.17 | 115 | 3/12/2026 |
| 4.0.16 | 113 | 3/12/2026 |
| 4.0.15 | 116 | 3/12/2026 |
| 4.0.14 | 122 | 3/12/2026 |
| 4.0.13 | 121 | 3/12/2026 |
| 4.0.12 | 76,749 | 3/11/2026 |
| 4.0.11 | 120 | 3/10/2026 |
| 4.0.10 | 24,770 | 3/10/2026 |
| 4.0.9 | 114 | 3/9/2026 |
| 4.0.8 | 119 | 3/9/2026 |
| 4.0.7 | 111 | 3/9/2026 |
| 4.0.5 | 281,210 | 2/4/2026 |
| 4.0.4 | 117 | 2/4/2026 |
Update actions/checkout action to v7 (#102)
Automatically merged