bthread可能突破数量限制
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
**Describe the bug (描述bug)**
现在每个worker的bthread数量限制是4096,但是bthread_start_urgent的产生不会校验worker上面的bthread的数量,这样一个worker上面的bthread数量就有可能突破4096。这块是否应该在bthread_start_urgent加个校验?这块加校验感觉会影响性能。
或者在EventDispatcher::Run()里面做一些校验?
**To Reproduce (复现方法)**
**Expected behavior (期望行为)**
**Versions (各种版本)**
OS:
Compiler:
brpc:
protobuf:
**Additional context/screenshots (更多上下文/截图)**
Contributor guide
Research direction
Start by reading the bthread_start_urgent path and EventDispatcher::Run() to understand where the per-worker limit of 4096 is enforced or bypassed. Compare the performance implications of checking in each location; done means preventing the worker’s bthread count from exceeding the limit without an unacceptable performance impact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100