-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acquire read lock instead of exclusive lock for langBaseCache. #4279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @arijitAD, @balajijinnah, and @manishrjain)
tok/langbase.go, line 55 at r1 (raw file):
langBaseCache.Lock() defer langBaseCache.Unlock()
After aquiring lock check once again whether. cache contains the lang or not. Some other routine may update the value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @balajijinnah and @manishrjain)
tok/langbase.go, line 55 at r1 (raw file):
Previously, balajijinnah (balaji) wrote…
After aquiring lock check once again whether. cache contains the lang or not. Some other routine may update the value
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)
@arijitAD Could this PR have impacted upsert performance? |
Reduces lock contention in langBaseCache by using RWMutex instead of Mutex.
This change is