我直接貼上一個問題 不過有點太簡單-_-a
Consider the following code segment:
pid_tpid;
pid = fork();
if (pid == 0) { /* child process */
fork();
thread_create( . . .);
}
fork();
a. How many unique processes are created?
b. How many unique threads are created?
Answer:
There are six processes and two threads.
請問答案為何是6個processes和2個threads?
要fork前後哪一個東西該怎麼看呢?
感謝