Tree of Processes with Arbitrary - Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task

 

Objectives 

  • Learn how to create and terminate processes.
  • Learn about process hierarchy.
  • Learning to use system calls fork(), exec(), wait(), getpid(), getppid()
  • Practice using command-line arguments and recursion. 

 

Description 

1. Your program should read two inputs from command line - the number of levels of the tree (L) and number of children of each internal node of the process tree (N).

2. Then your program should print the following information: 

(pid): Process starting (pid): Parent's id = (ppid) (pid): Level in the tree = (value_of_N_from_command_line) (pid): Creating (value_of_N_from_command_line) children at Level (L-1) 

In the above output, you should replace pid by the process id of the current process and ppid by the process id of the parent process.

3. Next, if the Level L is greater than 1, your program should create N child processes using forks), and wait for all of the children to complete using the wait() system call.

4. Once all the child processes (if any) have terminated, your program should quit by printing. 

 

 

 

This Computer Science Assignment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinctio.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.