Scalability to high numbers of threads suffers due to `try_wait()` calls
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Description
For an application with thousands of threads of equal priority, rr context switching can get very slow due to find_next_runnable_task, calling is_task_runnable on each thread, which in many cases (e.g. when almost all threads are blocked) calls RecordTask::try_wait which calls waitpid. I have an application with 2400 threads where rr spends almost all time in that waitpid syscall.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at find_next_runnable_task and follow its is_task_runnable path into RecordTask::try_wait, focusing on the waitpid calls described in the report. Reproduce or profile the workload with thousands of equal-priority threads, then define completion as avoiding the reported scalability bottleneck without changing scheduling behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- devtools, operating-systems, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100