Question

2Processes. Use the following assumptions to answer the questions: » All processes run to completion and no system calls will

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1-Which of the following are valid possible outputs for the program?

Answer-Option-(E) BCDA

2- If you run this program, how many processes will be created (parent + # of children)?

Answer-There is basically 2 child processes in the program 1 parent .

3-If printf ("E" ) ; 1s inserted on Line 18, how many times will E print?

Answer- 1 time

Add a comment
Know the answer?
Add Answer to:
2Processes. Use the following assumptions to answer the questions: » All processes run to completion and no system calls will fail printf ( is atomic and calls fflush (stdout) after printing argument...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. (20 pts.) Consider the following C program. Assume that all functions complete successfully. Complete the...

    1. (20 pts.) Consider the following C program. Assume that all functions complete successfully. Complete the Process Model, given that the process id's (pids) are as shown for each process created. Fill in the boxes for each variable, p1 and p2, showing how the values change in each process. Just cross out old values (don't erase). int main ) Process Model int p1 = o, p2-0; pl-fork ) if (pl !# 0) p2 fork ( ); if (plp2 0) printf...

  • Directions: use only the signal mechanism system calls don’t use ( wait() or pipe() )in this...

    Directions: use only the signal mechanism system calls don’t use ( wait() or pipe() )in this problem. You can still read/write from/to a file. You must use ( kill() and pause() ) system calls. rewrite code below to do kill and pause system calls #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/wait.h> // Function ptototypes int readX(); void writeX(int); int main() { int pid; // pid: used to keep track of the child process int x...

  • GIVEN CODE- FILL IN THE BLANK! #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h>...

    GIVEN CODE- FILL IN THE BLANK! #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/wait.h> // Function ptototypes int readX(); void writeX(int); int main() /// chi read x ---> divi ---> write x into file ---> par read x --> sub--> write x into file---> chi read x-->etc {    int pid;           // pid: used to keep track of the child process    int x = 19530;       // x: our value as integer   ...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT