A _|_ / \ B C __/ \__ / \ / \ D E F G \_/ \_/ \ / H I \_/ | JEach letter indicates an output operation that should output the corresponging letter, and flow of control is from top to bottom, with no loops. So, your program might, when run, output ABCDEFGHIJ, but it could, just as easily, output ACBFGIEDHJ. It should not, however, be able to output AHIJBCDEFG.
Big Hint: See lecture 4 and note the following.
If we assume that left branches in the above diagram are sequential processes, where the name of each process (for the sake of discussion) is the string of letters it prints, we have the following parent child relationships:
ABDHJ / \ CFI E | GHere, note that ABDHJ creates both CFI and E, and it must be prepared for them to terminate in any order. When forking, therefore, ABDHJ must remember the process IDs usef for both CFI and E, and when the time comes to join with E, if CFI terminates first, that must be remembered so that ABDHJ will not wait again for CFI after printing H.
For this implementation, discuss the problems you would encounter in a large scale shared memory multiprocessor where many CPU's (under the direction of the operating system) were competing to take processes from and add processes to the ready queue.