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


##########
src/server/worker.cc:
##########
@@ -564,6 +584,17 @@ void WorkerThread::Start() {
   LOG(INFO) << "[worker] Thread #" << t_.get_id() << " started";
 }
 
+std::map<int, redis::Connection *> Worker::GetConnections() const {
+  std::unique_lock<std::mutex> guard(conns_mu_);
+  std::map<int, redis::Connection *> result;
+  for (auto [fd, _] : conns_) {

Review Comment:
   Hi @mapleFU ,
   
   Yes, as you commented above, tbb doesn't guarantee the concurrency safe of 
STL style loop.
   I have replaced it with `tbb::parallel_for` and `range()` method.
   
   Best Regards,
   Edward



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