apache / apache/brpc

普通线程中调用bthread_start_background100次,在函数中打印对应的stack 100次执行的都是一个值,对应的cur_tid都是0,我打印前是取出来对应的值赋值局部变量打印的

Open
#2,042 13 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

并且打印的is_main_task都是true,这种是什么情况呢,这是在同一个bthread中执行的?

Contributor guide

Open the contributing guide

Research direction

Start with the bthread_start_background call path and reproduce the reported 100-call case from an ordinary thread. Trace how cur_tid and is_main_task are obtained inside the started function, then establish whether the calls share a bthread or why the printed values are identical; done means the behavior is explained and any required correction is covered by a reproducible check.

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
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.