产品概述
应用场景
产品架构
实例类型
兼容性说明
使用规范建议
BTHREAD_LIST视图用于展示当前系统中 bthread 协程的运行状态。列出当前所有活跃的 bthread,便于排查性能、阻塞、资源占用等问题。字段名 | 类型 | 描述 |
bthread_id | bigint unsigned | bthread 的唯一标识符。 |
stop | smallint unsigned | 标识 bthread 当前是否停止运行(0-运行中,1-已停止)。 |
interrupted | smallint unsigned | 表示其他线程是否调用了 bthread_interrupt 中断当前 bthread(0-未中断,1-已中断)。 |
about_to_quit | smallint unsigned | 表示当前 bthread 的调度能否推迟执行(0-不可推迟,1-可推迟)。 |
yield_count | smallint unsigned | 代表 bthread 让出(yield)计数器,用于决定当 bthread 主动让出 CPU 时,应该将它放入哪个队列。 |
fn | varchar(32) | bthread 调用入口函数的指针。 |
arg | varchar(32) | bthread 调用入口函数的参数的指针。 |
attr_stack_type | bigint unsigned | 栈类型,取值0-4,对应 bthread_stacktype_t 的值。 |
attr_flags | bigint unsigned | 位标志,对应 bthread_attrflags_t。 |
attr_keytable_pool | varchar(32) | 指向 keytable 的指针。 |
has_tls | smallint unsigned | 表示 bthread 是否有 TLS(线程本地存储)(0-无,1-有)。 |
uptime_ns | bigint | bthread 从创建到现在的总运行时长(纳秒)。 |
cputime_ns | bigint | bthread 实际占用 CPU 的执行时长(纳秒)。 |
nswitch | bigint | 上下文切换次数。 |
tdsql > SELECT * FROM information_schema.bthread_list limit 1 \\G*************************** 1. row ***************************bthread_id: 4294980352stop: 0interrupted: 0about_to_quit: 0yield_count: 0fn: 0x556eb9fd33a0arg: 0x7fbc1ab9cd40attr_stack_type: 3attr_flags: 0attr_keytable_pool: NULLhas_tls: 1uptime_ns: 71092709249214cputime_ns: 1273570nswitch: 31 row in set (0.00 sec)
文档反馈