Create a producer process and a consumer process sharing data. The producer generates total 100 integer data randomly, and the consumer process reads… | Cheap Nursing Papers

Create a producer process and a consumer process sharing data. The producer generates total 100 integer data randomly, and the consumer process reads…

  • Create a producer process and a consumer process sharing data. The producer generates total 100 integer data randomly, and the consumer process reads all the data. The data generated by the producer could be stored in a file by the producer; and the data consumed (i.e., read) by the consumer could be stored in another file by the consumer.
  •        The file of produced data and the file of consumed data could be printed to verity that the two processes have cooperated correctly; that means, each data item is not lost and not consumed more than once.
  •        Inter-process communication between producer and consumer (to share the data) can be implemented using any two of the following four methods:
  • Use a Pipe to transfer 100 data from the producer to the consumer.
  • Use either the direct message passing or indirect message passing (using a

mailbox or a message queue) to transfer 100 data from the producer to the consumer.

  • Use the sockets to transfer 100 data from the producer to the consumer.
  • Note: The producer and consumer processes can be executed on the same machine (or on different machines). A reference for socket programing is posted on the Pilot.
  • Use the shared memory and semaphores for the implementation of the logical

ring-buffer (that can store up to 10 data items) and the synchronization.

  • Programming Languages and Operating Systems:
  •        Any programming languages can be used for each implementation on any machine running any Operating Systems.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp