ZeroConcurrency 1.2.0
dotnet add package ZeroConcurrency --version 1.2.0
NuGet\Install-Package ZeroConcurrency -Version 1.2.0
<PackageReference Include="ZeroConcurrency" Version="1.2.0" />
<PackageVersion Include="ZeroConcurrency" Version="1.2.0" />
<PackageReference Include="ZeroConcurrency" />
paket add ZeroConcurrency --version 1.2.0
#r "nuget: ZeroConcurrency, 1.2.0"
#:package ZeroConcurrency@1.2.0
#addin nuget:?package=ZeroConcurrency&version=1.2.0
#tool nuget:?package=ZeroConcurrency&version=1.2.0
ZeroConcurrency
ZeroConcurrency is an enterprise-grade, pure C# lock-free concurrency, high-throughput streaming, and asynchronous execution engine for .NET. Engineered with zero external unmanaged dependencies, it delivers micro-to-nanosecond latency, zero GC allocations for steady-state workloads, and execution context bypass for mission-critical industrial automation, SCADA, edge IoT, and streaming pipelines.
Part of the ZeroUniverse / ZeroPlatform ecosystem.
Key Capabilities
1. Data-Plane: Lock-Free Ring Buffers & Off-Heap Disruptors
ZeroNativeRingBuffer(Off-Heap Disruptor):- High-speed Disruptor-style ring buffer storing unmanaged payloads directly in off-heap memory backed by
ZeroPrimitives.Memory.NativeMemoryPool. - Zero managed heap wrapping overhead; ideal for sensor data and camera frames between threads.
- High-speed Disruptor-style ring buffer storing unmanaged payloads directly in off-heap memory backed by
ZeroRingBuffer<T>(SPSC):- Single-Producer Single-Consumer lock-free circular queue.
- Strict 64-byte cache-line separation padding between producer (
_tail) and consumer (_head) to eliminate L1/L2 false sharing. - Power-of-two capacity bitmask wrapping for fast pointer advancement without modulo division.
- Over 10 million operations per second with 0 GC allocations.
ZeroMpmcRingBuffer<T>(MPMC):- Multi-Producer Multi-Consumer lock-free bounded queue based on Dmitry Vyukov's algorithm.
- Monotonic sequence barriers for contention mitigation and ABA prevention.
2. Control-Plane: Zero-Allocation Async & Scheduling Primitives
AsyncManualResetEvent&AsyncAutoResetEvent:- Zero-allocation awaitable synchronization primitives returning pooled
ValueTaskinstances. - Enables asynchronous thread coordination and gate signaling without GC pressure.
- Zero-allocation awaitable synchronization primitives returning pooled
ZeroWorkStealingPool:- Multi-threaded task execution engine with local per-worker queues and lock-free work stealing.
- Dynamically balances bursty compute workloads with minimal scheduling overhead.
ZeroPromise<T>&ZeroPromise:- Recyclable
IValueTaskSource<T>andIValueTaskSourceimplementations. - Integrated with
ZeroPromisePool<T>: automatically resets and recycles instances back to the lock-free pool as soon as the awaiter consumes the result. - Eliminates heap allocations for
ValueTaskcompletions in high-frequency request-reply or pipeline nodes.
- Recyclable
ZeroScheduler:- Bypasses
ExecutionContextcapture and restoration (noAsyncLocal, security context, or culture dictionary cloning). - Provides
IZeroWorkIteminterface to queue stateful tasks with 0 delegate closure allocations. - Cuts dispatch overhead by 30% - 50% compared to
Task.Run().
- Bypasses
ZeroDedicatedWorker:- Dedicated OS background worker with adaptive backoff (lightweight spin → yield → sleep).
- Guarantees sub-microsecond response time for sensor capture, serial streams, and frame pump loops.
3. Channels: Go-Style CSP Concurrency
ZeroChannel<T>:- Communicating Sequential Processes (CSP) channel modeled after Go channels (
chan T). - Backed by lock-free ring buffering and
ZeroPromise. - Supports synchronous zero-copy fast-paths (
TryWrite,TryRead) and asynchronous continuations (WriteAsync,ReadAsync,ReadAllAsync).
- Communicating Sequential Processes (CSP) channel modeled after Go channels (
Multi-Targeting
- .NET 8.0+ (Modern high-throughput JIT, hardware intrinsics)
- .NET Standard 2.0 (Cross-platform compatibility)
- .NET Framework 4.6.2 (Legacy enterprise and industrial HMI support)
Quick Example
High-Speed Go-Style Channel
using System;
using System.Threading.Tasks;
using ZeroPlatform.Concurrency;
var channel = new ZeroChannel<int>(capacityPowerOfTwo: 1024);
// Producer
_ = Task.Run(async () =>
{
for (int i = 1; i <= 100_000; i++)
{
await channel.WriteAsync(i);
}
channel.Complete();
});
// Consumer (0-allocation streaming)
await foreach (var item in channel.ReadAllAsync())
{
// Process item
}
Architecture
ZeroConcurrency/
├── Channels/
│ └── ZeroChannel.cs # Go-style CSP channel (chan T)
├── ControlPlane/
│ ├── AsyncResetEvents.cs # Zero-allocation AsyncManualResetEvent & AsyncAutoResetEvent
│ ├── ZeroWorkStealingPool.cs # Multi-threaded work-stealing job pool
│ ├── IZeroWorkItem.cs # Zero-allocation work item interface
│ ├── ZeroDedicatedWorker.cs # Pinned OS thread streaming worker
│ ├── ZeroPromise.cs # Reusable IValueTaskSource & pool
│ └── ZeroScheduler.cs # ExecutionContext bypass scheduler
└── DataPlane/
├── ZeroNativeRingBuffer.cs # Off-heap Disruptor RingBuffer backed by NativeMemoryPool
├── ZeroMpmcRingBuffer.cs # Lock-free MPMC queue
└── ZeroRingBuffer.cs # Lock-free SPSC cache-line padded ring
📜 Release History
| Version | Release Date | Key Milestones & Highlights |
|---|---|---|
v1.2.0 |
2026-09-22 | Tier 0 Concurrency Hardening & Off-Heap Disruptor:<br/>• Integrated with ZeroPrimitives.Core 1.3.0 off-heap foundation.<br/>• Added ZeroNativeRingBuffer: Off-heap Disruptor RingBuffer managing unmanaged memory blocks with 0 GC overhead.<br/>• Added AsyncManualResetEvent & AsyncAutoResetEvent: Zero-allocation awaitable synchronization primitives.<br/>• Added ZeroWorkStealingPool: Dedicated multi-threaded worker pool with work stealing.<br/>• Verified across 31 automated tests (100% pass rate). |
v1.1.0 |
2026-09-16 | MPMC Ring Buffers & Go Channels:<br/>• Added ZeroMpmcRingBuffer<T> lock-free multi-producer multi-consumer ring.<br/>• Added ZeroChannel<T> CSP channels with async iterator streaming.<br/>• Added ZeroDedicatedWorker pinned thread loop. |
v1.0.0 |
2026-09-12 | Initial Release:<br/>• ZeroRingBuffer<T> SPSC cache-line padded ring.<br/>• ZeroPromise & ZeroPromisePool reusable ValueTask source.<br/>• ZeroScheduler ExecutionContext bypass dispatcher. |
License
MIT License. Copyright © 2026 Phong Võ (kzxl).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZeroPrimitives.Core (>= 1.3.0)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZeroPrimitives.Core (>= 1.3.0)
-
net8.0
- ZeroPrimitives.Core (>= 1.3.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on ZeroConcurrency:
| Package | Downloads |
|---|---|
|
ZeroUI.Core
High-performance, zero-allocation core runtime and industrial automation infrastructure for .NET (SQLite Historian, Modbus TCP, Siemens S7, PackML, OEE, UiDispatcher, WorkerQueue). |
|
|
ZeroComm.Core
Package Description |
|
|
ZeroNetwork.Core
High-performance, zero-dependency .NET networking suite: IP/CIDR math, active ARP scanner, WoL, UDP multicast, micro HTTP/1.1 server with REST router and Prometheus metrics, streaming REST client, WebSocket client (RFC 6455), and pure C# SignalR Hub client. |
|
|
ZeroVideo
Enterprise Pure C# Video Streaming, RTSP/RTP Transport, Industrial MJPEG Multipart Client, H.264 NALU Scanner, Snapshot BMP Exporter & Low-Latency Frame Buffer for .NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.