1.

What Is Fork()?

Answer»

Fork system call is used to create a new PROCESS. Fork is called onces and returns twice.It will return 0 to the newly CREATED process (child process) and process id of child to the calling process(parent process). 

The child process gets copy of PARENTS data, STACK and heap segement.The code segement is common for both.Both the processes will resume execution from the command next to fork.Scheduler DECIDE which process to run first.

Fork system call is used to create a new process. Fork is called onces and returns twice.It will return 0 to the newly created process (child process) and process id of child to the calling process(parent process). 

The child process gets copy of parents data, stack and heap segement.The code segement is common for both.Both the processes will resume execution from the command next to fork.Scheduler decide which process to run first.



Discussion

No Comment Found