2

このリンクを見つけました:

スレッドとプロセスのスタックに関する簡単な質問

スレッドに個別のスタックがある理由は理解していますが、プロセスに 2 つのスタックがある可能性があることを読みました。どうしてこれなの?プロセス スタック + スレッド スタックをカウントしているからでしょうか。

4

2 に答える 2

4

It is explained there:

  • A process can have at least one thread, but it can have many more
  • One thread has exactly one stack

So, if you say, that "One process can have two stacks" is partially true. The process itself does not have any stacks, but its threads have - as many as the number of threads.

于 2013-02-05T13:34:44.440 に答える