You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wangbo (via GitHub)" <gi...@apache.org> on 2023/04/13 03:28:16 UTC

[GitHub] [doris] wangbo commented on a diff in pull request #18588: [feature-wip](resource-group) support resource group interface in be.

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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org