Skip to content

Commit

Permalink
[bugfix] fix snd thd cannot notify fst thd bug, degrade snd thd usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunelFeng committed Oct 21, 2024
1 parent 066c014 commit 4d570f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/UtilsCtrl/ThreadPool/UThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,8 @@ CStatus UThreadPool::releaseSecondaryThread(CInt size) {
CIndex UThreadPool::dispatch(CIndex origIndex) {
CIndex realIndex = 0;
if (CGRAPH_DEFAULT_TASK_STRATEGY == origIndex) {
/**
* 如果是默认策略信息,在[0, default_thread_size_) 之间的,通过 thread 中queue来调度
* 在[default_thread_size_, max_thread_size_) 之间的,通过 pool 中的queue来调度
*/
realIndex = cur_index_++;
if (cur_index_ >= config_.max_thread_size_ || cur_index_ < 0) {
if (cur_index_ >= config_.default_thread_size_ || cur_index_ < 0) {
cur_index_ = 0;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/UtilsCtrl/ThreadPool/UThreadPoolDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static const CInt CGRAPH_MAX_LOCAL_BATCH_SIZE = 2;
static const CInt CGRAPH_MAX_POOL_BATCH_SIZE = 2; // 批量执行通用任务最大值
static const CInt CGRAPH_MAX_STEAL_BATCH_SIZE = 2; // 批量盗取任务最大值
static const CInt CGRAPH_PRIMARY_THREAD_BUSY_EPOCH = 5; // 主线程进入wait状态的轮数,数值越大,理论性能越高,但空转可能性也越大
static const CMSec CGRAPH_PRIMARY_THREAD_EMPTY_INTERVAL = 20; // 主线程进入休眠状态的默认时间
static const CMSec CGRAPH_PRIMARY_THREAD_EMPTY_INTERVAL = 1000; // 主线程进入休眠状态的默认时间
static const CSec CGRAPH_SECONDARY_THREAD_TTL = 10; // 辅助线程ttl,单位为s
static const CBool CGRAPH_MONITOR_ENABLE = false; // 是否开启监控程序
static const CSec CGRAPH_MONITOR_SPAN = 5; // 监控线程执行间隔,单位为s
Expand Down

0 comments on commit 4d570f2

Please sign in to comment.