You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2023/02/27 23:24:21 UTC

[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9442: Replace exclusive locks with rwlocks in hostdb

ywkaras commented on code in PR #9442:
URL: https://github.com/apache/trafficserver/pull/9442#discussion_r1119417471


##########
iocore/hostdb/HostDB.cc:
##########
@@ -625,29 +640,34 @@ probe(const Ptr<ProxyMutex> &mutex, HostDBHash const &hash, bool ignore_timeout)
   }
 
   // Otherwise HostDB is enabled, so we'll do our thing
-  ink_assert(this_ethread() == hostDB.refcountcache->lock_for_key(hash.hash.fold())->thread_holding);
-  uint64_t folded_hash = hash.hash.fold();
+  uint64_t folded_hash           = hash.hash.fold();
+  std::shared_mutex &bucket_lock = hostDB.refcountcache->lock_for_key(folded_hash);

Review Comment:
   Why not use ts::shared_mutex to avoid the risk of writer starvation?



-- 
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: github-unsubscribe@trafficserver.apache.org

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