Question: Divide the inventory program into two parts in order to separate the initialization and processing part from the user I / O part. Use the
Divide the inventory program into two parts in order to separate the initialization and processing part from the user IO part. Use the command line to supply the inventory file name to the initializationprocessing part of the program. The initializationprocessing part then reads the file to populate the data and then closes the file which completes the initialization. The initializationprocessing part then creates two pipes. After this it forks to create another process and with the second process it executes the IO part. The IO part performs all interactions with the user. You will need to create protocols on the pipes between the processing part and the IO part. For instance, on a find record the IO part might first write an integer, say to communicate to the processing part that it needs to find a record. After that the IO places information on the pipe that is necessary for the processing part to perform the find. The processing part finds the record and sends the data to the IO part maybe sending the record index too The IO part would than display the record and ask the user something like what next? This continues until the user chooses save and exit or exit no save When an exit message is sent, sleep the IO process for seconds to ensure the message is received before terminating.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
