Soenneker.Atomics.ValueNullableLazys
4.0.2
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Atomics.ValueNullableLazys --version 4.0.2
NuGet\Install-Package Soenneker.Atomics.ValueNullableLazys -Version 4.0.2
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="Soenneker.Atomics.ValueNullableLazys" Version="4.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Atomics.ValueNullableLazys" Version="4.0.2" />
<PackageReference Include="Soenneker.Atomics.ValueNullableLazys" />
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 Soenneker.Atomics.ValueNullableLazys --version 4.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Atomics.ValueNullableLazys, 4.0.2"
#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 Soenneker.Atomics.ValueNullableLazys@4.0.2
#: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=Soenneker.Atomics.ValueNullableLazys&version=4.0.2
#tool nuget:?package=Soenneker.Atomics.ValueNullableLazys&version=4.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Atomics.ValueNullableLazys
Allocation-conscious lazy initialization that correctly caches null values.
Installation
dotnet add package Soenneker.Atomics.ValueNullableLazys
Usage
using Soenneker.Atomics.ValueLocks;
using Soenneker.Atomics.ValueNullableLazys;
public sealed class Resolver
{
private ValueNullableLazy<Result> _result;
private ValueAtomicLock _initializationLock;
public Result? Resolve() =>
_result.GetOrCreate(ref _initializationLock, this,
static resolver => resolver.TryResolve());
}
ValueNullableLazy<T> occupies one reference-sized field and uses a private sentinel to distinguish “not initialized” from “initialized with null.” Several lazy fields on an owner can share one ValueAtomicLock.
GetOrCreateprovides execution-and-publication semantics.GetOrCreatePublicationOnlymay run the factory concurrently but atomically publishes one result.GetOrCreateUnsafeperforms no synchronization.TryGetValuereturnstrueafter initialization even when the cached value isnull.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Soenneker.Atomics.ValueLocks (>= 4.0.3)
-
net9.0
- Soenneker.Atomics.ValueLocks (>= 4.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Atomics.ValueNullableLazys:
| Package | Downloads |
|---|---|
|
Soenneker.Reflection.Cache
The fastest .NET Reflection cache |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.36 | 5,793 | 10/15/2026 |
| 4.0.35 | 562 | 10/14/2026 |
| 4.0.34 | 2,298 | 10/14/2026 |
| 4.0.33 | 52 | 10/14/2026 |
| 4.0.30 | 3,464 | 10/13/2026 |
| 4.0.27 | 48 | 10/13/2026 |
| 4.0.26 | 89 | 10/12/2026 |
| 4.0.24 | 6,102 | 10/12/2026 |
| 4.0.23 | 5,041 | 10/11/2026 |
| 4.0.22 | 128 | 10/11/2026 |
| 4.0.21 | 126,555 | 9/24/2026 |
| 4.0.20 | 100 | 9/24/2026 |
| 4.0.19 | 37,846 | 9/15/2026 |
| 4.0.18 | 107 | 9/15/2026 |
| 4.0.17 | 110 | 9/15/2026 |
| 4.0.16 | 39,669 | 9/12/2026 |
| 4.0.15 | 359 | 9/12/2026 |
| 4.0.14 | 3,797 | 9/12/2026 |
| 4.0.13 | 4,926 | 9/12/2026 |
| 4.0.2 | 51,999 | 8/27/2026 |
Loading failed