return to UNIX

Write a program creating 2 processes - parent and child. Child process at random intervals of 0.1s, 0.2s, 0.3s, 0.4s or 0.5s sends SIGRTMIN to parent process. Parent process with equal probability 50% send back SIGRTMIN or SIGRTMAX. Child must analyse the answer and print '-' for SIRGTMIN or '+' for SIGRTMAX. This process continues in a loop. At each iteration child process can terminate with 1% probability. Parent process must immediately terminate when child process dies or after n-th iteration. Output from child process must be printed in one line (e.g. ++-+---++)

Program takes sole positive integer argument n > 0

This task will be graded by Marcin Borkowski, please submit your solutions to /home2/samba/borkowskim/unix/ folder.

Additional Remarks:

return to UNIX