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
23
Volo.Abp.DistributedLocking.Abstractions
Package Description
22
Volo.Abp.DistributedLocking.Abstractions
Package Description
21
Volo.Abp.DistributedLocking.Abstractions
Package Description
20
Volo.Abp.DistributedLocking.Abstractions
Package Description
19

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
7.1.4 11 11/29/2024
7.1.4-preview 9 12/01/2024
7.1.3 10 11/14/2024
7.1.2 8 12/24/2024
7.1.0-alpha 9 01/19/2025
7.0.2 13 10/18/2024
7.0.1 15 08/21/2024
7.0.0 15 07/24/2024
7.0.0-rc3 14 07/23/2024
7.0.0-rc2 14 07/23/2024
7.0.0-rc1 15 06/30/2024
7.0.0-beta 15 06/30/2024
7.0.0-alpha 14 06/30/2024
6.4.2 19 04/26/2024
6.4.1 18 05/01/2024
6.4.0 18 05/10/2024
6.3.4 25 02/01/2024
6.3.4-rc 20 01/31/2024
6.3.4-beta 17 02/01/2024
6.3.3 18 01/17/2024
6.3.2 17 01/17/2024
6.3.0 19 01/17/2024
6.2.6 20 01/13/2024
6.2.5 21 01/08/2024
6.2.5-alpha 20 01/03/2024
6.2.4 21 12/20/2023
6.2.3 20 12/15/2023
6.2.3-beta 21 12/19/2023
6.2.2 22 10/19/2023
6.2.1 33 06/02/2023
6.2.0 22 07/01/2023
6.1.1 21 07/02/2023
6.1.1-rc 28 10/18/2023
6.1.1-beta 21 06/20/2023
6.1.0 23 07/01/2023
6.0.5 22 07/02/2023
6.0.5-alpha 22 06/19/2023
6.0.4 22 06/19/2023
6.0.4-rc6 22 06/30/2023
6.0.4-rc5 25 06/20/2023
6.0.4-rc3 22 06/19/2023
6.0.4-rc 23 06/19/2023
6.0.4-beta 19 07/02/2023
6.0.4-alpha 25 07/02/2023
6.0.3 23 06/21/2023
6.0.2 23 07/02/2023
6.0.1 25 06/19/2023
5.1.2 19 06/20/2023
5.1.1 23 06/30/2023
5.1.0 22 07/19/2023
5.0.4 18 06/20/2023
5.0.3 25 07/14/2023
5.0.3-rc 21 06/30/2023
5.0.2-rc 22 06/21/2023
5.0.1 24 06/30/2023
4.0.2 26 07/01/2023
3.2.3 23 08/05/2023
3.2.1 20 06/20/2023
3.2.0 24 06/20/2023
3.0.1 22 06/19/2023
3.0.0 23 07/02/2023
2.0.3 20 06/19/2023
2.0.2 22 07/02/2023
2.0.1 19 06/19/2023
2.0.0 23 06/19/2023
1.1.0 22 06/19/2023
1.0.1 22 07/01/2023
1.0.0 25 06/20/2023