Skip to content

[bugfix] fix threadpool lost wakup for 1s#585

Merged
ChunelFeng merged 1 commit intoChunelFeng:mainfrom
yeshenyong:fix/202602262245
Feb 28, 2026
Merged

[bugfix] fix threadpool lost wakup for 1s#585
ChunelFeng merged 1 commit intoChunelFeng:mainfrom
yeshenyong:fix/202602262245

Conversation

@yeshenyong
Copy link
Copy Markdown
Collaborator

如何导致 1s 卡顿:

  1. 主线程 faitwait() -> cur_empty_epoch 轮转 =5 , 为true
  2. 主线程 -> 准备获取 mutex (还没进入wait_for)
  3. 提交线程 pushTask -> 推入任务
  4. 提交线程 cur_empty_epoch = 0 无锁写,data race
  5. 提交线程 notify 丢失
  6. 主线程获取 mutex wait for 1000ms
  7. 主线程白等

@ChunelFeng
Copy link
Copy Markdown
Owner

我相信,这是问题的根源。留下两个扩展问题:

1,为什么perfomance的case中,从来不出现空等1s的情况。

2,每次写入都上锁,开销太大。如何尽可能降低不必要的开销?

@ChunelFeng ChunelFeng merged commit aa872a8 into ChunelFeng:main Feb 28, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants