CoreSystem.Memory
1.0.0
dotnet add package CoreSystem.Memory --version 1.0.0
NuGet\Install-Package CoreSystem.Memory -Version 1.0.0
<PackageReference Include="CoreSystem.Memory" Version="1.0.0" />
<PackageVersion Include="CoreSystem.Memory" Version="1.0.0" />
<PackageReference Include="CoreSystem.Memory" />
paket add CoreSystem.Memory --version 1.0.0
#r "nuget: CoreSystem.Memory, 1.0.0"
#:package CoreSystem.Memory@1.0.0
#addin nuget:?package=CoreSystem.Memory&version=1.0.0
#tool nuget:?package=CoreSystem.Memory&version=1.0.0
⚡ CoreSystem.Memory
Lightweight in-memory synchronization library for .NET 8
CoreSystem.Memory provides keyed asynchronous locks for coordinating concurrent operations within a single process. It is lightweight, thread-safe, dependency injection friendly, and designed for production workloads.
✨ Features
- ✅ Keyed asynchronous locking
- ✅ Thread-safe implementation
- ✅ Automatic lock lifecycle management
- ✅ Lightweight and allocation-friendly
- ✅ Dependency Injection integration
- ✅ Designed for .NET 8
- ✅ Production-ready
📦 Installation
dotnet add package CoreSystem.Memory
🚀 Quick Start
Register the services:
builder.Services.AddCoreMemory();
Inject the lock provider:
public sealed class OrderService(IMemoryLockProvider lockProvider)
{
}
Acquire a keyed lock:
await using (await lockProvider.AcquireAsync($"orders:{orderId}"))
{
// Critical section
}
🏗 Typical Use Cases
- Prevent concurrent processing of the same entity.
- Protect critical sections inside ASP.NET Core applications.
- Synchronize background jobs.
- Avoid duplicate in-process operations.
- Coordinate access to shared resources.
📚 Design
Each key has its own asynchronous lock backed by SemaphoreSlim. Locks
are created on demand and automatically removed when no longer in use,
preventing unnecessary memory growth.
Application
│
▼
IMemoryLockProvider
│
▼
ConcurrentDictionary
│
▼
SemaphoreSlim
⚠️ Important
CoreSystem.Memory synchronizes execution only inside the current process.
For synchronization across multiple application instances or servers, use a distributed locking solution such as Redis.
🤝 Contributing
Issues and pull requests are welcome.
📄 License
Released under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net8.0
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CoreSystem.Memory:
| Package | Downloads |
|---|---|
|
CoreSystem.Cache
Distributed cache abstraction for .NET 8 supporting Redis and In-Memory providers, with native OpenTelemetry integration. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 131 | 7/8/2026 |
Initial stable release.
• In-memory keyed asynchronous lock provider
• Thread-safe synchronization
• Automatic lock lifecycle management
• Dependency Injection integration
• Production-ready implementation