各プロセスはスレッドと見なされますか?

各プロセスはスレッドと見なされますか?

Linuxプロセスはスレッドと見なされますか?

たとえば、pthread_createを呼び出してmain()に新しいスレッドを生成する単純なCプログラムを書くとしたら、これは2つのスレッド(main()用のスレッドと新しく作成されたスレッド用のスレッド)があることを意味しますか?それとも、生成されたスレッドだけがスレッドとしてカウントされますが、main()プロセスは計算されませんか?

pthread_joinを呼び出して生成されたスレッドをmain()に結合すると、次のように見えます。スレッドを一緒に接続つまり、メインプロセスがスレッドであることを意味します。

また、誤った用語を使用した場合は訂正してください。 :)

ベストアンサー1

man pthreads私のコンピュータから

 In  addition  to  the **main (initial) thread**, and the threads that the 
 program creates using pthread_create(3), the implementation creates a 
 "manager" thread.  This thread handles thread creation and termination.
 (Problems can result if this thread  is  inad‐ vertently killed.)

おすすめ記事