删除线程

更新时间:
2024-03-14
下载文档

删除线程

在程序调测或系统管理时,有时需要手动删除某些线程,此时可以通过 kill 命令加线程ID来实现。

[root@sylixos:/root]# ts
thread show >>

      NAME         TID    PID  PRI STAT LOCK SAFE    DELAY   PAGEFAILS FPU CPU
---------------- ------- ----- --- ---- ---- ---- ---------- --------- --- ---
t_idle0          4010000     0 255 RDY     0 YES           0         0       0
t_itimer         4010001     0  20 SLP     0 YES       96809         0       0
t_isrdefer       4010002     0   0 SEM     0 YES           0         0       0
t_except         4010003     0   0 SEM     0 YES           0         0       0
t_log            4010004     0  60 MSGQ    0 YES           0         0       0
t_power          4010005     0 254 RDY     0 YES           0         0       0
t_hotplug        4010006     0 250 SEM     0 YES         993         0       0
t_reclaim        4010008     0 253 MSGQ    0 YES           0         0       0
t_sync           4010009     0 252 SLP     0             992         0       0
t_dcwpipe        401000a     0 160 SEM     0               0         0       0
t_tpsfs          401000b     0 160 SLP     0            1007         0       0
t_console        401000c     0 150 MSGQ    0 YES           0         0       0
t_netjob         401000d     0 110 SEM     0 YES           0         0       0
t_netproto       401000e     0 110 MSGQ    0 YES           6         0       0
t_snmp           401000f     0 110 MSGQ    0 YES           0         0       0
t_ftpd           4010010     0 160 MSGQ    0               0         0       0
t_telnetd        4010011     0 160 MSGQ    0 YES           0         0       0
t_jobq           4010013     0 200 SEM     0 YES           0         0       0
t_xinput         4010015     0 199 SEM     0               0         0       0
t_tshell         4010016     0 150 RDY     1               0         0       0
t_tshell         4010018     0 150 SEM     0               0         0       0

thread: 21
[root@sylixos:/root]# kill 4010010
[root@sylixos:/root]# ts
thread show >>

      NAME         TID    PID  PRI STAT LOCK SAFE    DELAY   PAGEFAILS FPU CPU
---------------- ------- ----- --- ---- ---- ---- ---------- --------- --- ---
t_idle0          4010000     0 255 RDY     0 YES           0         0       0
t_itimer         4010001     0  20 SLP     0 YES       72051         0       0
t_isrdefer       4010002     0   0 SEM     0 YES           0         0       0
t_except         4010003     0   0 SEM     0 YES           0         0       0
t_log            4010004     0  60 MSGQ    0 YES           0         0       0
t_power          4010005     0 254 SLP     0 YES         250         0       0
t_hotplug        4010006     0 250 SEM     0 YES         235         0       0
t_reclaim        4010008     0 253 MSGQ    0 YES           0         0       0
t_sync           4010009     0 252 SLP     0             234         0       0
t_dcwpipe        401000a     0 160 SEM     0               0         0       0
t_tpsfs          401000b     0 160 SLP     0             248         0       0
t_console        401000c     0 150 MSGQ    0 YES           0         0       0
t_netjob         401000d     0 110 SEM     0 YES           0         0       0
t_netproto       401000e     0 110 MSGQ    0 YES          46         0       0
t_snmp           401000f     0 110 MSGQ    0 YES           0         0       0
t_telnetd        4010011     0 160 MSGQ    0 YES           0         0       0
t_jobq           4010013     0 200 SEM     0 YES           0         0       0
t_xinput         4010015     0 199 SEM     0               0         0       0
t_tshell         4010016     0 150 RDY     1               0         0       0
t_tshell         4010018     0 150 SEM     0               0         0       0

thread: 20
[root@sylixos:/root]#
文档内容是否对您有所帮助?
有帮助
没帮助