[Previous] [Up] [Next]
Go backward to Processes -- fork() & wait() functions
Go up to Labs
Go forward to Daemon processes & Logging

Processes -- signals

Modify the previous program to use signals, wait() and pause().

Please add the following features to the program.

  1. Set up a timer that stops the program after about 20 seconds. The main process should kill off all remaining children at this time. The main process should also print out the uppercase character for each child as it terminates. (In the order of termination.) (A sequence of upper case letters.)
  2. Set up a processes to accept the SIGQUIT signal from the keyboard. When the process gets the signal it needs to send a signal to yet another process (SIGUSR1). This process should print its letter in uppercase indicating the arrival of the signal.
  3. Another processes need to receive the above signal (SIGUSR1). And also print out its letter in uppercase.
  4. The 2 signal handling processes mentioned above need to delay for one second between printing out their lower case character.
  5. One process needs to sent out 30 characters at one second intervals. This process will go on longer than the main process, and be killed off by the main process.
  6. Modify the rest of (or, all of) the processes to use usleep() to that the delay between characters is about 50ms. This should allow even fast systems to mix the order of the processes. You may need to reduce this to 20ms on some systems.
  7. The "j" process. The one with the newlines and the spaces needs to be on of the fast processes.
Turn in a printed copy of your program and a copy of its output.
ltaber@pima.edu

[Previous] [Up] [Next]