wangbo commented on code in PR #18588:
URL: https://github.com/apache/doris/pull/18588#discussion_r1164945636


##########
be/src/runtime/task_group/task_group.h:
##########
@@ -60,23 +66,40 @@ using TGEntityPtr = TaskGroupEntity*;
 
 class TaskGroup {
 public:
-    TaskGroup(uint64_t id, std::string name, uint64_t cpu_share);
+    TaskGroup(uint64_t id, std::string name, uint64_t cpu_share, int64_t 
version);
 
     TaskGroupEntity* task_entity() { return &_task_entity; }
 
-    uint64_t share() const { return _share; }
+    uint64_t cpu_share() const {
+        std::shared_lock<std::shared_mutex> rl {mutex};
+        return _cpu_share;

Review Comment:
   How about using std::atomic for _cpu_share?
   method cpu_share() will be called frequently.
   Maybe just keep the eventually consistency?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to