mapleFU commented on code in PR #2461:
URL: https://github.com/apache/kvrocks/pull/2461#discussion_r1701947296
##########
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:
Besides, I'm still curious that what did the mutex protect after this patch.
Since we use open-tbb now, the concurrent hash map would brings up much more
cost ( on both memory usage and search time) than std::unordered_map, would a
extra lock and synchronization break the potential performance speedup and
causing the performance worse than before? Would you mind add `// guarded by`
for the protected element?
--
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]