AsyncKeyedLock 6.2.6-alpha

AsyncKeyedLock AsyncKeyedLock

GitHub Workflow Status NuGet NuGet Codacy Grade Codecov

An asynchronous .NET Standard 2.0 library that allows you to lock based on a key (keyed semaphores), limiting concurrent threads sharing the same key to a specified number, with optional pooling for reducing memory allocations.

For example, suppose you were processing financial transactions, but while working on one account you wouldn't want to concurrently process a transaction for the same account. Of course, you could just add a normal lock, but then you can only process one transaction at a time. If you're processing a transaction for account A, you may want to also be processing a separate transaction for account B. That's where AsyncKeyedLock comes in: it allows you to lock but only if the key matches.

The library uses two very different methods for locking, one using an underlying ConcurrentDictionary that's cleaned up after use whilst the other using a technique called striped locking. Both have their advantages and disadvantages, and in order to help you choose you are highly recommended to read about it in the wiki.

Installation and usage

The documentation can be found in our wiki.

Credits

Check out our list of contributors!

Showing the top 20 packages that depend on AsyncKeyedLock.

Packages Downloads
Volo.Abp.DistributedLocking.Abstractions
Package Description
21
Volo.Abp.DistributedLocking.Abstractions
Package Description
20
Volo.Abp.DistributedLocking.Abstractions
Package Description
19
Volo.Abp.DistributedLocking.Abstractions
Package Description
18

Cleaning pooling and aggressively inlining locking methods.

.NET 5.0

  • No dependencies.

.NET 8.0

  • No dependencies.

.NET Standard 2.0

.NET Standard 2.1

  • No dependencies.

Version Downloads Last updated
8.0.2 10 2/17/2026
8.0.1 9 1/24/2026
8.0.1-alpha 13 1/4/2026
8.0.0 19 1/4/2026
8.0.0-beta2 16 1/4/2026
8.0.0-beta 18 1/4/2026
7.1.8 20 12/11/2025
7.1.8-beta5 16 12/12/2025
7.1.8-beta4 17 12/12/2025
7.1.8-beta3 15 12/12/2025
7.1.8-beta2 16 12/12/2025
7.1.8-beta 14 12/12/2025
7.1.8-alpha 15 1/4/2026
7.1.7 16 12/12/2025
7.1.6 17 12/12/2025
7.1.5 14 1/4/2026
7.1.5-alpha 14 12/12/2025
7.1.4 12 12/12/2025
7.1.4-preview 18 12/12/2025
7.1.3 18 12/12/2025
7.1.2 14 1/4/2026
7.1.1 14 1/4/2026
7.1.0 13 1/4/2026
7.1.0-alpha 15 1/4/2026
7.0.2 17 12/12/2025
7.0.1 16 12/12/2025
7.0.1-alpha 13 1/4/2026
7.0.0 15 12/12/2025
7.0.0-rc3 16 12/12/2025
7.0.0-rc2 15 12/12/2025
7.0.0-rc1 15 12/12/2025
7.0.0-beta 15 12/12/2025
7.0.0-alpha 16 12/12/2025
6.4.2 16 12/12/2025
6.4.1 15 12/12/2025
6.4.0 19 12/12/2025
6.3.4 16 12/12/2025
6.3.4-rc 15 12/12/2025
6.3.4-beta 21 12/12/2025
6.3.4-alpha 13 1/4/2026
6.3.3 16 12/12/2025
6.3.2 16 12/12/2025
6.3.1 12 1/4/2026
6.3.0 15 12/12/2025
6.2.7-alpha 14 1/4/2026
6.2.6 24 12/12/2025
6.2.6-alpha 14 1/4/2026
6.2.5 24 12/12/2025
6.2.5-alpha 12 1/4/2026
6.2.4 22 12/12/2025
6.2.3 21 12/12/2025
6.2.3-beta 17 12/12/2025
6.2.2 19 12/12/2025
6.2.2-beta 15 1/4/2026
6.2.2-alpha 13 1/4/2026
6.2.1 15 12/12/2025
6.2.0 17 12/12/2025
6.2.0-alpha 12 1/4/2026
6.1.2-rc 14 1/4/2026
6.1.2-beta 16 1/4/2026
6.1.2-alpha 14 1/4/2026
6.1.1 17 12/12/2025
6.1.1-rc 18 12/12/2025
6.1.1-beta 12 12/12/2025
6.1.0 21 12/12/2025
6.0.5 23 12/12/2025
6.0.5-alpha 18 12/12/2025
6.0.4 18 12/12/2025
6.0.4-rc6 16 12/12/2025
6.0.4-rc5 13 12/12/2025
6.0.4-rc3 17 12/12/2025
6.0.4-rc2 13 1/4/2026
6.0.4-rc 18 12/11/2025
6.0.4-beta 19 12/12/2025
6.0.4-alpha 13 12/12/2025
6.0.3 20 12/12/2025
6.0.2 22 12/12/2025
6.0.1 15 12/12/2025
6.0.0 18 1/4/2026
5.1.3-beta 14 1/4/2026
5.1.3-alpha 13 1/4/2026
5.1.2 19 12/12/2025
5.1.1 20 12/12/2025
5.1.1-rc 11 1/4/2026
5.1.1-alpha 13 1/4/2026
5.1.0 18 12/12/2025
5.1.0-alpha 11 1/4/2026
5.0.6-alpha 14 1/4/2026
5.0.5-rc 13 1/4/2026
5.0.5-alpha 12 1/4/2026
5.0.4 15 12/12/2025
5.0.3 22 12/12/2025
5.0.3-rc 15 12/12/2025
5.0.2-rc 14 12/12/2025
5.0.1 19 12/12/2025
5.0.0 13 1/4/2026
4.0.2 18 12/12/2025
4.0.1 17 1/4/2026
4.0.0 13 1/4/2026
3.2.3 18 12/12/2025
3.2.1 21 12/12/2025
3.2.0 18 12/12/2025
3.1.1 14 1/4/2026
3.1.0 13 1/4/2026
3.0.1 15 12/12/2025
3.0.0 17 12/12/2025
2.0.3 19 12/12/2025
2.0.2 18 12/12/2025
2.0.1 14 12/12/2025
2.0.0 22 12/12/2025
1.1.0 20 12/12/2025
1.0.1 18 12/12/2025
1.0.0 16 12/12/2025