CS 471 Operating
Prof. Daniel A. Menasce
Assignment on Process Creation in UNIX

The purpose of this project is to give you some hands-on experience in the use of UNIX system calls to create processes. This will be the first step in the preparation for project 1.

Advance Preparation: Log into a UNIX system (site or osf1 for instance) and print and study the man pages for the fork system call and for the waitpid system call.

The Problem:
A process P, forks a process Q. After forking Q, process P executes a loop 20 times in which it prints "Process P: loop i" where i is the iteration number. In each iteration of the loop, process P executes an I/O operation on a file (any file). Process Q executes a loop 20 times in which it prints "Process Q: loop i" where i is the iteration number and terminates. Process Q executes an I/O operation on any file on every odd numbered iteration and a very large computation on every even numbered iteration. The large computation can be a loop which executes 1000 floating point arithmetic statements.

P should only complete when Q has finished.

Run you experiment 20 times and observe the results.

What did you observe in your experiments?
What have you learned from it?

You should turn in an individual report containing your program in the appendix.