![]() |
VOOZH | about |
dotnet add package Soenneker.Asyncs.Locks --version 4.0.53
NuGet\Install-Package Soenneker.Asyncs.Locks -Version 4.0.53
<PackageReference Include="Soenneker.Asyncs.Locks" Version="4.0.53" />
<PackageVersion Include="Soenneker.Asyncs.Locks" Version="4.0.53" />Directory.Packages.props
<PackageReference Include="Soenneker.Asyncs.Locks" />Project file
paket add Soenneker.Asyncs.Locks --version 4.0.53
#r "nuget: Soenneker.Asyncs.Locks, 4.0.53"
#:package Soenneker.Asyncs.Locks@4.0.53
#addin nuget:?package=Soenneker.Asyncs.Locks&version=4.0.53Install as a Cake Addin
#tool nuget:?package=Soenneker.Asyncs.Locks&version=4.0.53Install 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
This library provides a single primitive: AsyncLock.
AsyncLock is built to be the fastest possible correct mutex for real-world .NET systems.
It provides the following guarantees:
dotnet add package Soenneker.Asyncs.Locks
await using (await _lock.Lock(ct))
{
// critical section
}
using (_lock.LockSync())
{
// critical section
}
if (_lock.TryLock(out var releaser))
{
using (releaser)
{
// critical section
}
}
| Method | Mean | Error | StdDev | Median | Ratio | Allocated |
|---|---|---|---|---|---|---|
| Soenneker.Asyncs.Lock | 10.06 ns | 0.212 ns | 0.393 ns | 10.01 ns | baseline | - |
| SemaphoreSlim | 19.17 ns | 0.406 ns | 0.360 ns | 19.10 ns | 1.91x slower | - |
| Nito.AsyncEx.AsyncLock | 55.32 ns | 1.078 ns | 2.645 ns | 54.81 ns | 5.51x slower | 320 B |
| Method | Mean | Error | StdDev | Median | Ratio | Allocated |
|---|---|---|---|---|---|---|
| Soenneker.Asyncs.Lock | 8.09 ns | 0.179 ns | 0.314 ns | 8.03 ns | baseline | - |
| SemaphoreSlim | 19.49 ns | 0.403 ns | 0.727 ns | 19.09 ns | 2.41x slower | - |
| Nito.AsyncEx.AsyncLock | 48.43 ns | 1.005 ns | 2.915 ns | 48.05 ns | 6.00x slower | 320 B |
| 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 5 NuGet packages that depend on Soenneker.Asyncs.Locks:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.AsyncSingleton
An externally initializing singleton that uses double-check asynchronous locking, with optional async and sync disposal |
|
|
Soenneker.Utils.BackgroundQueue
A high-performance background Task/ValueTask queue |
|
|
Soenneker.Dictionaries.SingletonKeys
An externally initializing singleton dictionary that uses double-check asynchronous locking, with optional async and sync disposal |
|
|
Soenneker.Blazor.Utils.Session
A Blazor utility for automatic navigation after JWT expiration |
|
|
Soenneker.Asyncs.Initializers
A lightweight, async-safe, allocation-free one-time initialization gate. Ensures a given asynchronous initialization routine runs exactly once, even under concurrent callers, with support for cancellation, safe publication, and disposal. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.53 | 14,560 | 6/15/2026 |
| 4.0.52 | 121,279 | 6/6/2026 |
| 4.0.51 | 22,298 | 6/6/2026 |
| 4.0.50 | 398 | 6/5/2026 |
| 4.0.49 | 5,521 | 6/5/2026 |
| 4.0.48 | 100 | 6/5/2026 |
| 4.0.47 | 266,906 | 4/23/2026 |
| 4.0.46 | 7,826 | 4/23/2026 |
| 4.0.45 | 2,822 | 4/23/2026 |
| 4.0.44 | 5,698 | 4/23/2026 |
| 4.0.41 | 242,637 | 3/13/2026 |
| 4.0.40 | 9,557 | 3/13/2026 |
| 4.0.39 | 280 | 3/13/2026 |
| 4.0.38 | 1,043 | 3/12/2026 |
| 4.0.37 | 243 | 3/12/2026 |
| 4.0.36 | 250 | 3/12/2026 |
| 4.0.35 | 1,023 | 3/12/2026 |
| 4.0.34 | 582 | 3/12/2026 |
| 4.0.33 | 72,834 | 3/11/2026 |
| 4.0.32 | 8,575 | 3/11/2026 |
cleanup