Now, recompile and run the program.
Note that the normal termination of a process may be accomplished
with
kill <process-id>.
In this case, a signal is sent to the process to stop the process. However,
in some cases, more drastic action is needed, and the statement
kill -KILL <process-id>
directs the operating system to do whatever is necessary to make the
process terminate.
Now change the 10 (formerly 22) to 30 and rerun. Again, describe the effect and explain why this happens.
read(fd[0], line, MAX);
printf ("The string received is '%s'\n", line);
read(fd[0], line, MAX);
printf ("The string received is '%s'\n", line);
That is, perform the reading and printing twice. Rerun, describe, and
explain what happens.
write (fd[1], "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26); write (fd[1], "abcdefghijklmnopqrstuvwxyz", 26);At the same time, restore the code for the child to contain just one read of line with a single corresponding printf. Rerun, describe, and explain the result.
data_g = 10; /* change data elements */ data_l = 12;from the beginning of the code for the parent process to the beginning of the child's code segment. Recompile and rerun. Compare this output with that from the previous step (step 12), and explain any differences.
This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/213.fa98/lab-concurrency.html