Soenneker.Atomics.ValueNullableLazys 4.0.2

Prefix Reserved
There is a newer version of this package available.
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" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Atomics.ValueNullableLazys" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Atomics.ValueNullableLazys&version=4.0.2
                    
Install 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 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.

  • GetOrCreate provides execution-and-publication semantics.
  • GetOrCreatePublicationOnly may run the factory concurrently but atomically publishes one result.
  • GetOrCreateUnsafe performs no synchronization.
  • TryGetValue returns true after initialization even when the cached value is null.
Product 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.

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