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

  1. 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:

  2. 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?

  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!