Exam 1, Question 5 Solution

Written by Sanghwan Lee

(20 pts.)

A.
Process ID and parent process ID will be different.
Since they are different processes, they should have different process Ids.
And also their parents are different, they should have different parent process Ids.
Child process ID List : their child processes are different too.

Other Answers from students.
Address space mapping information is different too.
Return value of fork()

B.

To do process synchronization, one of the two processes should wait until the other finishes the job.
In the UNIX system, the easiest way to wait until a process finishes something is to call wait() or waitpid() system calls.
These two system calls are for the parent process to wait it's child processes, not vice versa.
So it is the normal way that the child process call exec.

Other Answers from students.
If parent calls exec(), the child become an orphan.
Not to destroy parent process.