1. Engineering
  2. Computer Science
  3. 1 10 points how many new processes are created in...

Question: 1 10 points how many new processes are created in...

Question details

1. (10 points) How many new processes are created in the below program assuming calls to fork succeeds? Explain your answer int main(void) for (int i -0:i<3, i+) pid t pid fork0 2. (15 points) Considering the following code void foo 0 void bar 0 main 0 t Thread t1createThread (foo); Thread 12 createThread(bar); WaitForAllDone0 Note that function WaitForAllDone blocks the main thread until both threads it creates are done. Assume that memory load and memory store are atomic, but add and time are not atomic a) What is the maximum number of threads that are ever alive (this includes those one the ready or waiting lists, or running) in this program? Give all possible outputs of this program. Explain your answer and be specific. b)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution