We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi~ I read the code of client_manager.go, and I have a question about mutex. For example:
one part:
func (m *ClientManager) Add(client *Client)
... m.mu.Unlock() m.removeOldest() m.mu.Lock()
two part:
func (m *ClientManager) removeOldest() { m.mu.Lock() ele := m.ll.Back() m.mu.Unlock() if ele != nil { m.removeElement(ele) } } func (m *ClientManager) removeElement(e *list.Element) { m.mu.Lock() defer m.mu.Unlock() m.ll.Remove(e) delete(m.cache, e.Value.(*managerItem).key) }
It seems that it can not need "two" m.mu.Lock ?
The below codes are right? func (m *ClientManager) Add(client *Client)
... m.removeOldest()
If I just use m.mu.Lock once, it is not good for high concurrency?
Can you answer me about this question?
I appreciate it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi~
I read the code of client_manager.go, and I have a question about mutex. For example:
one part:
func (m *ClientManager) Add(client *Client)
two part:
It seems that it can not need "two" m.mu.Lock ?
The below codes are right?
func (m *ClientManager) Add(client *Client)
If I just use m.mu.Lock once, it is not good for high concurrency?
Can you answer me about this question?
I appreciate it
The text was updated successfully, but these errors were encountered: