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.
- 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.)
- 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.
- Another processes need to receive the above signal
(SIGUSR1). And also print out its letter
in uppercase.
- The 2 signal handling processes mentioned above need to
delay for one second between printing out their lower case character.
- 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.
- 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.
- 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