in Operating System edited by
571 views
0 votes
0 votes

Consider the following code segment:

pid t pid;
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?

in Operating System edited by
571 views

1 comment

5 child process and 1 parent.

4 threads
0
0

3 Answers

2 votes
2 votes
process=6

threads created=2
0 votes
0 votes
8 threads and 6 processes.
0 votes
0 votes

Number of Process=6

Number of threads= 2

Refer to this Link : http://mjgeiger.github.io/OS/prev/sp17/homework/OSsp17_hw2_soln.pdf

Related questions