Skip to content
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

Can getValue use RLock? #80

Open
Cyufei87 opened this issue Jul 28, 2021 · 2 comments
Open

Can getValue use RLock? #80

Cyufei87 opened this issue Jul 28, 2021 · 2 comments

Comments

@Cyufei87
Copy link

c.mu.Lock()

can here use RLock to decrease lock race?

@jrynd
Copy link

jrynd commented Jul 22, 2023

sort of...getValue() checks if the item has expired, and deletes it if it has. So you'd have to convert the reader lock to a full lock.

@jrynd
Copy link

jrynd commented Jul 22, 2023

Also the cache engine supports a loaderFunc that will attempt to generate a value if it's not found in the cache. That would also require a real Lock.

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

No branches or pull requests

2 participants