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 I/O part. Use the command line to supply the inventory file name to the initialization/processing part of the program. The initialization/processing part then reads the file to populate the data and then closes the file which completes the initialization. The initialization/processing part then creates two pipes. After this it forks to create another process and with the second process it executes the I/O part. The I/O part performs all interactions with the user. You will need to create protocols on the pipes between the processing part and the I/O part. For instance, on a find record the I/O part might first write an integer, say 3, to communicate to the processing part that it needs to find a record. After that the I/O 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 I/O part (maybe sending the record index too). The I/O 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 I/O process for 10 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!