[ 
https://issues.apache.org/jira/browse/GEODE-8553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17205159#comment-17205159
 ] 

ASF GitHub Bot commented on GEODE-8553:
---------------------------------------

gaussianrecurrence commented on a change in pull request #660:
URL: https://github.com/apache/geode-native/pull/660#discussion_r497868084



##########
File path: cppcache/src/ThinClientLocatorHelper.cpp
##########
@@ -74,10 +74,15 @@ ThinClientLocatorHelper::ThinClientLocatorHelper(
       m_sniProxyHost(sniProxyHost),
       m_sniProxyPort(sniProxyPort) {
   for (auto&& locatorAddress : locatorAddresses) {
-    m_locHostPort.emplace_back(locatorAddress);
+    m_Locators.emplace_back(locatorAddress);
   }
 }
 
+std::vector<ServerLocation> ThinClientLocatorHelper::getLocators() const {

Review comment:
       Regarding the lack of necessity for this member function to be 
const-qualified, this is totally true, but on the other hand, all but 
updateLocators member function could be const-qualified as they don't modify 
the object state.
   
   My opinion on this is make everything const-qualified unless strictly 
necessary, this way you don't have problems to integrate with other 
implementations.
   
   An example of this is:
   We had this project in which we we trying to do PdxInstance deserialization, 
and the method deseralize was const-qualified and given, several methods in 
PdxInstance weren't const-qualified, we needed to use the const_cast nasty 
trick :S
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Reduce ThinClientLocatorHelper lock time
> ----------------------------------------
>
>                 Key: GEODE-8553
>                 URL: https://issues.apache.org/jira/browse/GEODE-8553
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>    Affects Versions: 1.12.0, 1.13.0
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>              Labels: pull-request-available
>
> During my troublshootings, I've seen that locking m_locatorLock for the whole 
> scope of the class function members might cause some inter-locks.
> Problem here and in many other places of the NC is that networking operations 
> are performed while a mutex is locked. Therefore if *thread A* takes longer 
> than expected in performing its network operation, it might block another one 
> which does not requires any resource of the first *thread A*. Hence, the 
> inter-lock.
> This improvement is the first one of a series regarding to lock scope 
> reduction when it comes with code regarding networking in NC.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to