Asynchronous locking based on a key

As the other answerer noted, the original code is removing the SemaphoreSlim from the ConcurrentDictionary before it releases the semaphore. So, you’ve got too much semaphore churn going on – they’re being removed from the dictionary when they could still be in use (not acquired, but already retrieved from the dictionary). The problem with this … Read more