Question
Although we did not spend time in lecture to study signals SIGCONT and SIGSTOP, it is not hard at all to see how these two
Although we did not spend time in lecture to study signals SIGCONT and SIGSTOP, it is not hard at all to see how these two signals work. Read the brief description on these two signals in textbook on page 317 and 320.
Then follow the steps below to create your own program to observe how these two signals work. a) In the main function, fork a child process.
b) In the child process, using an infinite loop to print out something. For example, you can print out the value of an int variable and each iteration increase the value of this int variable. You may also optionally sleep for a second or two in the loop to slow down the loop.
c) In the parent process, sleep for a few second first, then send the SIGSTOP signal to the child process.
d) In the parent process, again sleep for a few second, then send the SIGONT signal to the child process.
e) Lastly, in the parent process, you can send the SIGINT signal to the child process to terminate it.
When running your program, observe what happens at step c) and d). Is the child process stopped and continued upon the receipt of the signals?
Submit your source code. Your source code should be commented at least for the above steps a) to e) so that we know how you implemented them. Script running your program with timing option and submit them as well.
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
The SIGSTOP signal is used to stop a process execution The SIGCONT signal is used to continue execut...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started