search
Log In
1 vote
32 views
Including the initial parent process, how many processes are created by the following program.

#include <stdio.h>
#include <unistd.h>
int main()
{
fork();             
fork();             
fork();
return 0;
}
in Operating System
edited by
32 views

1 Answer

1 vote

total number of child process created= 7.

Related questions

0 votes
0 answers
1
107 views
#include <sys/types.h> #include <stdio.h> #include <unistd.h> int value = 5; int main() { pid t pid; pid = fork(); if (pid == 0) { /* child process */ value += 15; return 0; } else if (pid > 0) { /* parent process */ wait(NULL); printf("PARENT: value = %d",value); /* LINE A */ return 0; } } Explain what the output will be at LINE A in this program.
asked Mar 19, 2019 in Operating System akash.dinkar12 107 views
0 votes
0 answers
2
51 views
Assume that a distributed system is susceptible to server failure. What mechanisms would be required to guarantee the “exactly once” semantic for execution of RPCs?
asked Mar 19, 2019 in Operating System akash.dinkar12 51 views
0 votes
0 answers
3
46 views
Consider the “exactly once”semantic with respect to the RPC mechanism. Does the algorithm for implementing this semantic execute correctly even if the ACK message sent back to the client is lost due to a network problem? Describe the sequence of messages, and discuss whether “exactly once” is still preserved.
asked Mar 19, 2019 in Operating System akash.dinkar12 46 views
0 votes
0 answers
4
22 views
When a process creates a new process using the fork() operation, which of the following states is shared between the parent process and the child process ? a. Stack b. Heap c. Shared memory segments
asked Mar 19, 2019 in Operating System akash.dinkar12 22 views
...