tencent cloud

TDSQL Boundless

BTHREAD_LIST

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-03-06 18:48:07

Function

The BTHREAD_LIST view displays the operational status of bthread coroutines in the current system. It lists all active bthreads, enabling troubleshooting of performance, blocking, and resource consumption issues.

Field Description

Field Name
Type
Description
bthread_id
bigint unsigned
The unique identifier for a bthread.
stop
smallint unsigned
Indicates whether the bthread is currently stopped (0 - running, 1 - stopped).
interrupted
smallint unsigned
Indicates whether another thread has called bthread_interrupt to interrupt the current bthread (0 - not interrupted, 1 - interrupted).
about_to_quit
smallint unsigned
Indicates whether the scheduling of the current bthread can be deferred (0 - cannot be deferred, 1 - can be deferred).
yield_count
smallint unsigned
Represents the bthread (yield) counter, which is used to determine which queue a bthread should be placed in when it actively yields the CPU.
fn
varchar(32)
The pointer to the entry function called by the bthread.
arg
varchar(32)
The pointer to the parameters of the entry function called by the bthread.
attr_stack_type
bigint unsigned
Stack type, with values 0-4, corresponding to the values of bthread_stacktype_t.
attr_flags
bigint unsigned
Bit flags, corresponding to bthread_attrflags_t.
attr_keytable_pool
varchar(32)
The pointer to the keytable.
has_tls
smallint unsigned
Indicates whether the bthread has TLS (Thread Local Storage) (0 - none, 1 - present).
uptime_ns
bigint
The total runtime of the bthread since its creation (in nanoseconds).
cputime_ns
bigint
The actual CPU execution time occupied by the bthread (in nanoseconds).
nswitch
bigint
Number of context switches.

Examples

tdsql > SELECT * FROM information_schema.bthread_list limit 1 \\G
*************************** 1. row ***************************
bthread_id: 4294980352
stop: 0
interrupted: 0
about_to_quit: 0
yield_count: 0
fn: 0x556eb9fd33a0
arg: 0x7fbc1ab9cd40
attr_stack_type: 3
attr_flags: 0
attr_keytable_pool: NULL
has_tls: 1
uptime_ns: 71092709249214
cputime_ns: 1273570
nswitch: 3
1 row in set (0.00 sec)

Ajuda e Suporte

Esta página foi útil?

comentários