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

why Cache.locks not choice RWMutex?? #24

Closed
dotNetDR opened this issue Jun 10, 2017 · 2 comments
Closed

why Cache.locks not choice RWMutex?? #24

dotNetDR opened this issue Jun 10, 2017 · 2 comments

Comments

@dotNetDR
Copy link

	cache.locks[segId].Lock()  // 对于同一个Key读是堵塞的么?
	value, err = cache.segments[segId].get(key, hashVal)
	cache.locks[segId].Unlock()
@dotNetDR
Copy link
Author

读多写少的场景。这个是可以换RWMutex的不?

@coocood
Copy link
Owner

coocood commented Jun 10, 2017

It's not read only, get modifies the access time of the entry.

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