wenxuwan commented on a change in pull request #82:
URL: https://github.com/apache/dubbo-getty/pull/82#discussion_r749883543



##########
File path: session.go
##########
@@ -418,11 +422,28 @@ func (s *session) WriteBytes(pkg []byte) (int, error) {
                return 0, ErrSessionClosed
        }
 
-       lg, err := s.Connection.send(pkg)
+       leftPackageSize, totalSize, writeSize := len(pkg), len(pkg), 0
+       s.wlock.Lock()

Review comment:
       In my opinion, the wlock used for protect big package send, so may be u 
can change the wlock to rwMutex, and only when package size bigger than 16kb, 
try to get Lock, other times and other places you can use Rlock.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to