mapleFU commented on code in PR #2461:
URL: https://github.com/apache/kvrocks/pull/2461#discussion_r1701931221


##########
src/server/worker.h:
##########
@@ -88,9 +91,10 @@ class Worker : EventCallbackBase<Worker>, 
EvconnlistenerBase<Worker> {
   UniqueEvent timer_;
   std::thread::id tid_;
   std::vector<evconnlistener *> listen_events_;
-  std::mutex conns_mu_;
-  std::map<int, redis::Connection *> conns_;
-  std::map<int, redis::Connection *> monitor_conns_;
+  mutable std::mutex conns_mu_;  // refer to 
https://github.com/oneapi-src/oneTBB/issues/183, traverse and erase should

Review Comment:
   I've take a look at tbb's code, and seems that the iterator it's just a 
wrapper to making the hash_map looks like a hash map in STL 😅
   
   
https://github.com/oneapi-src/oneTBB/blob/master/include/oneapi/tbb/concurrent_hash_map.h#L1043-L1046
   
   What about here?



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

Reply via email to