AsyncKeyedLock 6.2.5-alpha

AsyncKeyedLock AsyncKeyedLock

GitHub Workflow Status NuGet NuGet Codacy Grade

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
46
Volo.Abp.DistributedLocking.Abstractions
Package Description
45
Volo.Abp.DistributedLocking.Abstractions
Package Description
44
Volo.Abp.DistributedLocking.Abstractions
Package Description
43
Volo.Abp.DistributedLocking.Abstractions
Package Description
42
Volo.Abp.DistributedLocking.Abstractions
Package Description
41

Highly experimental performance improvements

.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.1.3 7 11/16/2026
8.1.3-preview 4 11/16/2026
8.1.2 24 9/20/2026
8.1.1 25 9/20/2026
8.0.2 52 2/17/2026
8.0.1 44 1/24/2026
8.0.1-alpha 41 1/4/2026
8.0.0 55 1/4/2026
8.0.0-beta2 50 1/4/2026
8.0.0-beta 49 1/4/2026
7.1.8 47 12/11/2025
7.1.8-beta5 44 12/12/2025
7.1.8-beta4 51 12/12/2025
7.1.8-beta3 46 12/12/2025
7.1.8-beta2 52 12/12/2025
7.1.8-beta 50 12/12/2025
7.1.8-alpha 47 1/4/2026
7.1.7 45 12/12/2025
7.1.6 51 12/12/2025
7.1.5 44 1/4/2026
7.1.5-alpha 45 12/12/2025
7.1.4 47 12/12/2025
7.1.4-preview 47 12/12/2025
7.1.3 47 12/12/2025
7.1.2 45 1/4/2026
7.1.1 42 1/4/2026
7.1.0 49 1/4/2026
7.1.0-alpha 47 1/4/2026
7.0.2 46 12/12/2025
7.0.1 41 12/12/2025
7.0.1-alpha 51 1/4/2026
7.0.0 43 12/12/2025
7.0.0-rc3 46 12/12/2025
7.0.0-rc2 44 12/12/2025
7.0.0-rc1 44 12/12/2025
7.0.0-beta 48 12/12/2025
7.0.0-alpha 48 12/12/2025
6.4.2 44 12/12/2025
6.4.1 42 12/12/2025
6.4.0 50 12/12/2025
6.3.4 48 12/12/2025
6.3.4-rc 49 12/12/2025
6.3.4-beta 51 12/12/2025
6.3.4-alpha 44 1/4/2026
6.3.3 44 12/12/2025
6.3.2 52 12/12/2025
6.3.1 49 1/4/2026
6.3.0 44 12/12/2025
6.2.7-alpha 50 1/4/2026
6.2.6 52 12/12/2025
6.2.6-alpha 47 1/4/2026
6.2.5 55 12/12/2025
6.2.5-alpha 42 1/4/2026
6.2.4 52 12/12/2025
6.2.3 57 12/12/2025
6.2.3-beta 47 12/12/2025
6.2.2 58 12/12/2025
6.2.2-beta 49 1/4/2026
6.2.2-alpha 45 1/4/2026
6.2.1 45 12/12/2025
6.2.0 47 12/12/2025
6.2.0-alpha 40 1/4/2026
6.1.2-rc 44 1/4/2026
6.1.2-beta 48 1/4/2026
6.1.2-alpha 45 1/4/2026
6.1.1 49 12/12/2025
6.1.1-rc 48 12/12/2025
6.1.1-beta 43 12/12/2025
6.1.0 55 12/12/2025
6.0.5 60 12/12/2025
6.0.5-alpha 48 12/12/2025
6.0.4 48 12/12/2025
6.0.4-rc6 47 12/12/2025
6.0.4-rc5 44 12/12/2025
6.0.4-rc3 48 12/12/2025
6.0.4-rc2 44 1/4/2026
6.0.4-rc 51 12/11/2025
6.0.4-beta 50 12/12/2025
6.0.4-alpha 42 12/12/2025
6.0.3 51 12/12/2025
6.0.2 53 12/12/2025
6.0.1 42 12/12/2025
6.0.0 47 1/4/2026
5.1.3-beta 44 1/4/2026
5.1.3-alpha 44 1/4/2026
5.1.2 50 12/12/2025
5.1.1 59 12/12/2025
5.1.1-rc 42 1/4/2026
5.1.1-alpha 45 1/4/2026
5.1.0 50 12/12/2025
5.1.0-alpha 44 1/4/2026
5.0.6-alpha 46 1/4/2026
5.0.5-rc 40 1/4/2026
5.0.5-alpha 45 1/4/2026
5.0.4 46 12/12/2025
5.0.3 57 12/12/2025
5.0.3-rc 43 12/12/2025
5.0.2-rc 41 12/12/2025
5.0.1 47 12/12/2025
5.0.0 47 1/4/2026
4.0.2 50 12/12/2025
4.0.1 48 1/4/2026
4.0.0 42 1/4/2026
3.2.3 49 12/12/2025
3.2.1 53 12/12/2025
3.2.0 48 12/12/2025
3.1.1 48 1/4/2026
3.1.0 50 1/4/2026
3.0.1 45 12/12/2025
3.0.0 47 12/12/2025
2.0.3 47 12/12/2025
2.0.2 49 12/12/2025
2.0.1 42 12/12/2025
2.0.0 54 12/12/2025
1.1.0 54 12/12/2025
1.0.1 51 12/12/2025
1.0.0 46 12/12/2025