Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

ConcurrentDictionaryRepository not being used appropriately. #95

Open
sagarnarla opened this issue Mar 22, 2017 · 0 comments
Open

ConcurrentDictionaryRepository not being used appropriately. #95

sagarnarla opened this issue Mar 22, 2017 · 0 comments

Comments

@sagarnarla
Copy link

sagarnarla commented Mar 22, 2017

While ConcurrentDictionaryRepository offers a thread safe IThrottleRepository implementation the ThrottlingCore always acquires lock before using the IThrottleRepository. Thus obviating the need for thread safe implementation.
ThrottlingCore.cs line:198

lock (ProcessLocker)
{
var entry = Repository.FirstOrDefault(id);
// Code here
// stores: id (string) - timestamp (datetime) - total (long)
Repository.Save(id, throttleCounter, timeSpan);
}`

@stefanprodan: Doesn't this defeat the purpose of having a ConcurrentDictionaryRepository which is to remove the bottle neck where all requests are made to wait for the lock.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant