forker.cwhich is linked to the web version of this homework contains a simple program that loops three times, each time calling the
forksystem call described in section 4.3.1 of the textbook. Afterward it
sleeps (does nothing) for 30 seconds. Download this file, compile it using the command
cc -o forker forker.cand then run it using the command
./forkerWhile the program is in its 30 second sleep, in a second terminal window do the command
ps xto get a listing of processes. How many processes are shown running the
./forkercommand? Explain by drawing a "family tree" of the processes, with one box for each process and a line connecting each (except the first one) to its parent.
printf("Child Complete");has been removed. In variant2, both that line and also the preceding line
wait(NULL);have been removed. Each of these variant programs is compiled and run in a shell terminal window. What difference might be observed between variant1's behavior and variant2's behavior? Explain. You are welcome to try the experiment if you would like. If you do so, be sure to look carefully at the output.
notifyAlloperation less often, without affecting its correctness?
notifyAllcan be safely changed to
AA BBand car CC arrives, it will park in one of the following two ways
AACC BB AA CCBBrather than
AA CC BBWhich kind of fragmentation is each part of town subject to? Explain, being sure to take into account what happens as parked cars leave and others take their place.
Instructor: Max Hailperin