You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/17 08:36:26 UTC
[GitHub] [incubator-doris] wuyunfeng commented on a change in pull request #4172: Simplify logic and improve efficiency
wuyunfeng commented on a change in pull request #4172:
URL: https://github.com/apache/incubator-doris/pull/4172#discussion_r471326590
##########
File path: be/src/util/blocking_priority_queue.hpp
##########
@@ -85,34 +85,32 @@ class BlockingPriorityQueue {
MonotonicStopWatch timer;
boost::unique_lock<boost::mutex> unique_lock(_lock);
- while (true) {
- if (!_queue.empty()) {
- // 定期提高队列中残留的任务优先级
- // 保证优先级较低的大查询不至于完全饿死
- if (_upgrade_counter > config::priority_queue_remaining_tasks_increased_frequency) {
- std::priority_queue<T> tmp_queue;
- while (!_queue.empty()) {
- T v = _queue.top();
- _queue.pop();
- ++v;
- tmp_queue.push(v);
- }
- swap(_queue, tmp_queue);
- _upgrade_counter = 0;
+ if (!_queue.empty()) {
+ // 定期提高队列中残留的任务优先级
Review comment:
Maybe you should write the comment using the English
----------------------------------------------------------------
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.
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