CS 3733 Operating Systems, Fall 1996 Assignment 4


  • Due on November 19 at the beginning of class.

    Modify Part 2 of Assignment 3 so that the processes can use signals as follows.

    The program should be called newsbiffsig.c and should take three command line parameters. These should be the same as the first three parameters for newsbiff from Assignment 3. The timeout will not be used. Modify the the program so that the original parent has an array containing the process IDs of all of the processes. You can use the method you used in ring6 of Part 1 of Assignment 3. It should also print its PID when it is entered. Modify the children so that when a child receives a SIGUSR1 signal it prints statistics about what it is monitoring including the time it started monitoring and the last time the newsgroup changed.

    Modify the original parent so that it too can receive SIGUSR1 but as a realtime signal. The value of the signal will be an integer which represents a number between 1 and the number of newsgroups being monitored. This corresponds to one of the children. It can be interpreted as the line number in the file containing the list of newsgroups to be monitored (the second command line parameter).

    When the original parent receives a realtime SIGUSR1 signal with an appropriate value, it sends a SIGUSR1 signal to the appropriate child. If an inappropriate value is given, a wanring message should be printed but the program should continue executing.

    When the original parent receives a SIGUSR2 signal it kills all of the other processes and exits after printing an appropriate message.

    Modify Program 5.3 from PUP so it just takes 2 command line arguments, a process ID and a signal value. Call this program rtkill. It sends a SIGUSR1 signal to the process with the given value. You can use this to test your program.

    Now modify the children so they keep monitoring forever, even after a news article comes in. When a news article comes in, a message is printed giving the name of the newsgroup and the time of modification. The process then resets resets its copy of the time of last modification so it can continue monitoring and report the next change.

    Important:
    In this assignment you are creating processes that can live indefinitely long. It is your responsibilty to kill off all of these processes before you logout.

    This assignment must be done on a machine running Solaris 2.5. Use pandora or a machine with name fourxx or fivexx.