
LinuxのCPUで待機しているスレッド数をプログラムで取得する方法はありますか?
答え1
psのマニュアルページのステータスフィールドは、スレッドが実行キューにあるかどうかを示します(スレッドを表示するには「L」オプションを使用)。
D uninterruptible sleep (usually IO)
R running or runnable (on run queue)
S interruptible sleep (waiting for an event to complete)
T stopped by job control signal
t stopped by debugger during the tracing
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z defunct ("zombie") process, terminated but not reaped by its parent