Question
3. Processes, Exceptions and Signals A parent process fork()ed a child process to create some large object. The child process wants to give the object
3. Processes, Exceptions and Signals
-
A parent process fork()ed a child process to create some large object. The child process wants to give the object back to the parent. Can this easily be done by signals? If yes, say how:
If no, say why not and give an alternative:
-
A parent process fork()s a child process. The child continues running the same program as the parent (it does not do a execl() or similar system call). Is the best way that the parent can give a data structure created before the fork() to the child by writing it to a file and having the child read that file?
If so, why? If not, why not?
-
Let us say you write a program to measure how quick a person's fingers are by trapping SIGINT and then asking them to pressCtrl-C as rapidly as possible. The SIGINT signal handler increments a global counter every time Ctrl-C is typed. After a predefined time it stops and prints the global counter divided by the time used. What is a fundamental problem with this program?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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