Homework 2

On your Linux computer

1. Enter and compile the code in Figure 4.8 of OSC, adding the following line before the WAIT call;

printf("parent process not waiting yet\n");

2. Run strace on the executable code, capturing both the parent and child process
as I showed in class on Monday.
3. Print the output of strace, and each time strace indicates a context switch occurring, add comments about the cause of the context switch & state which queue each of the two processes is on after the switch.
4. Print the output of the program, and comment on the order of the printf relative to the ls output.

Hand in #3 and #4

Make sure that you tab in your comments, so our grader can see them!