Skip to content

burakkarabekir/Opsys-Fork-Operation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpSys-Fork-Operation

Fork

Create a full binary process tree with height = 2,3,4,.. Each of the processes in the tree will create a text file with their own process id. Each of the child processes will write a random number into the text file. Each parent will sum the random number from children and write it into its text file. Finally the top(Parent/Root) process will print out the sum of all random numbers generated by the child nodes. You can read the man page of function to get the pid in Linux.

• Child Process: Creates a random number and writes it into a file named with its own process id. • Parent Process: Sums the values written by its child processes and writes summation into a file named with its own pid or print the result screen.