プロセスの「待機チャネル」とは何ですか?

8128

GNOMEシステムモニターの[プロセス]タブには、[待機チャネル]列があります。ここで最も一般的な値はpoll_schedule_timeoutですが、他の値も表示されます:0do_exitdo_waitfutex_wait_queue_mepipe_wait__ skb_recv_datagramunix_stream_data_wait

では、この「待機チャネル」列はどういう意味ですか?そして、おそらくその中のそれらの値のいくつかはどういう意味ですか?

スクリーンショット

ステファノパラッツォ

The waiting channel is the place in the Kernel where the task is currently waiting. A task has to wait for a Resource, which can be data or processing time. These two include network sockets, hardware, files, and so on; since most of them are just files, in Unix-like systems.

  • 0: The process isn't waiting

  • poll_schedule_timeout

    poll() is a system call1 used to handle I/O. It's similar to select().2

    Applications that use non-blocking I/O use these calls to see if they can read from or write to a file, withouth having to block it. They are often used for input/output streams, which may not be blocked (otherwise, perhaps your mouse would stop to move).

    The waiting channel poll_schedule_timeout indicates that a task is waiting for I/O, either hardware like keyboards and mice, sound devices or even network sockets.

    1. A function in the Kernel
    2. They are defined in <linux/poll.h>. poll was an implementation first seen in System V, select is the BSD UNIX equivalent.
  • futex_wait_queue_me:

    To explain this, we have to look at Locks. A lock is a saved state in the system that indicates that a task works with a resource. There can be, for example, only one task that reads a file. This task would lock the file, any other task1 that tries to read the file would know it's locked, and wait for the lock to go away, before it can access it. The same thing happens for processor time.

    Modern version of Linux (on most architectures) use a Futex (fast userspace mutex) lock in the kernel. Mutex, mutual exclusion, refers to the idea that a common resource can only be accessed by one task at any time. For this, flags in the system are set.

    If a process is waiting for a locked resource, this is called Busy Waiting or "Spinning", refering to the fact that it tries to access it over and over, until it can. A task is said to be blocked when it spins.

    あなたがこれを読むことができるならば、あなたはこの答えの少なくとも1つの間違いを訂正する義務があります:P

    Futex locks can be thought of as a number in userspace, that can be incremented or decremented by a task (in cases where the resource can be accessed by multiple tasks, this number can become greater than one). This is the number shown in the diagram4.

    These tasks enqueue themselves in the wait queue, a simple queue of tasks that need to do some work, once processing time is available, the tasks do their work and are removed from the queue.

    futex_wait_queue_me enqueues a tasks. It then waits for a signal, a time out or a wakeup. Task that are in this waiting channel are waiting not on the wait queue, they are waiting to be enqueued.


    1. A task can be either a Process3 or a Thread2
    2. A Thread is a sub-section of a Process. Many threads can run parallel
    3. A process is a full-blown program, it consists of one or more threads, though a program can consist of multiple processes as well.
    4. Remember, this is still a very high level view of things, it's not considering the implementation details
  • __skb_recv_datagram

    Wait for some data on a locked network socket.

  • sk_wait_data

    Wait for some data on a network socket.

  • do_exit

    これは、プロセスを終了する最後の部分です。nextをdo_exit()呼び出して、schedule()別のプロセスをスケジュールします。ときdo_exit()に呼び出され、プロセスがありますZOMBIE

  • do_wait

    プロセスがスケジューラの待機キューに追加されます。

  • pipe_waitunix_stream_data_wait

    プロセスはサブプロセスからのデータを待機しています。これは、たとえば、次の種類のコードを実行したときに発生します。

    echo | sleep 10 && echo hallo              # pipe
    

    または

    cat < hello.c                              # unix data stream
    
  • hrtimer_nanosleep

    hrtimer_nanosleep()メソッドを使用して、プロセスはスリープ状態です。この方法は、プログラムがナノ秒の精度で特定の時間間隔でスリープするために使用できます。

これらがすべてではありませんが、私は他のものを観察しませんでした。私が何かを逃した場合はコメントを投稿してください。

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

プロセスの「待機チャネル」とは何ですか?

分類Dev

ルーチンとプロセスの違いは何ですか

分類Dev

通知セットチャネルとFCMsubscribeToTopicの違いは何ですか?

分類Dev

AlsaのマスターチャンネルとPCMチャンネルの違いは何ですか?

分類Dev

マルチプロセッシングとサブプロセスの違いは何ですか?

分類Dev

正式な引数としてチャネルをクロージャに渡すことと、親スコープで定義されたチャネルを使用することの違いは何ですか?

分類Dev

IBM websphere MQ のチャネル出口とは何ですか?

分類Dev

Djangoチャネルはセロリと共存できますか

分類Dev

Djangoチャネルはセロリとどう違うのですか?

分類Dev

タスクマネージャの[プロセス]タブをCSVファイルとして保存する最も簡単な方法は何ですか?

分類Dev

Z / OSでのCOBOLネストプログラムとサブルーチンの違いは何ですか。

分類Dev

カプセル化とクロージャの違いは何ですか?

分類Dev

マルチコアプロシージャとマルチプロシージャシステムの違いは何ですか?

分類Dev

マルチコアプロシージャとマルチプロシージャシステムの違いは何ですか?

分類Dev

* nix疑似端末はどのように機能しますか?マスター/スレーブチャネルとは何ですか?

分類Dev

* nix疑似端末はどのように機能しますか?マスター/スレーブチャネルとは何ですか?

分類Dev

NVIDIA MPS(マルチプロセスサーバー)とCUDAストリームの関係は何ですか?

分類Dev

Linuxで他のプロセスシグナルをキャッチすることは可能ですか?

分類Dev

マルチコアプロセッサとマルチスレッドプロセッサ(SMT)の長所と短所は何ですか

分類Dev

プロセス作成時のLinuxプロセスのカーネルスタック状態は何ですか?

分類Dev

DTDでは、<!ELEMENTチャネル(評価)*>と<!ELEMENTチャネル(評価)*>の違いは何ですか?

分類Dev

DTDでは、<!ELEMENTチャネル(評価)*>と<!ELEMENTチャネル(評価)*>の違いは何ですか?

分類Dev

hp-ux ps、スリープと待機の違いは何ですか?

分類Dev

Goでチャネルとファイル記述子の両方を同時に待機することはできますか?

分類Dev

スイッチとパッチパネルは、個人の家のセットアップでキャビネットを必要としますか?

分類Dev

スイッチとパッチパネルは、個人の家のセットアップでキャビネットを必要としますか?

分類Dev

マルチプロセッサとマルチプロセッシングシステムの違いは何ですか?

分類Dev

JSchの「shell」チャネルと「exec」チャネルの違いは何ですか

分類Dev

匿名関数がgolangのチャネルで永久に待機するとどうなりますか?

Related 関連記事

  1. 1

    プロセスの「待機チャネル」とは何ですか?

  2. 2

    ルーチンとプロセスの違いは何ですか

  3. 3

    通知セットチャネルとFCMsubscribeToTopicの違いは何ですか?

  4. 4

    AlsaのマスターチャンネルとPCMチャンネルの違いは何ですか?

  5. 5

    マルチプロセッシングとサブプロセスの違いは何ですか?

  6. 6

    正式な引数としてチャネルをクロージャに渡すことと、親スコープで定義されたチャネルを使用することの違いは何ですか?

  7. 7

    IBM websphere MQ のチャネル出口とは何ですか?

  8. 8

    Djangoチャネルはセロリと共存できますか

  9. 9

    Djangoチャネルはセロリとどう違うのですか?

  10. 10

    タスクマネージャの[プロセス]タブをCSVファイルとして保存する最も簡単な方法は何ですか?

  11. 11

    Z / OSでのCOBOLネストプログラムとサブルーチンの違いは何ですか。

  12. 12

    カプセル化とクロージャの違いは何ですか?

  13. 13

    マルチコアプロシージャとマルチプロシージャシステムの違いは何ですか?

  14. 14

    マルチコアプロシージャとマルチプロシージャシステムの違いは何ですか?

  15. 15

    * nix疑似端末はどのように機能しますか?マスター/スレーブチャネルとは何ですか?

  16. 16

    * nix疑似端末はどのように機能しますか?マスター/スレーブチャネルとは何ですか?

  17. 17

    NVIDIA MPS(マルチプロセスサーバー)とCUDAストリームの関係は何ですか?

  18. 18

    Linuxで他のプロセスシグナルをキャッチすることは可能ですか?

  19. 19

    マルチコアプロセッサとマルチスレッドプロセッサ(SMT)の長所と短所は何ですか

  20. 20

    プロセス作成時のLinuxプロセスのカーネルスタック状態は何ですか?

  21. 21

    DTDでは、<!ELEMENTチャネル(評価)*>と<!ELEMENTチャネル(評価)*>の違いは何ですか?

  22. 22

    DTDでは、<!ELEMENTチャネル(評価)*>と<!ELEMENTチャネル(評価)*>の違いは何ですか?

  23. 23

    hp-ux ps、スリープと待機の違いは何ですか?

  24. 24

    Goでチャネルとファイル記述子の両方を同時に待機することはできますか?

  25. 25

    スイッチとパッチパネルは、個人の家のセットアップでキャビネットを必要としますか?

  26. 26

    スイッチとパッチパネルは、個人の家のセットアップでキャビネットを必要としますか?

  27. 27

    マルチプロセッサとマルチプロセッシングシステムの違いは何ですか?

  28. 28

    JSchの「shell」チャネルと「exec」チャネルの違いは何ですか

  29. 29

    匿名関数がgolangのチャネルで永久に待機するとどうなりますか?

ホットタグ

アーカイブ