Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

In C++:This assignment requires you to make two processes (note: not threads) to demonstrate theproducer-consumer problem.The producer will input a file of passwords and a number of passwords to...

1 answer below »
In C++:
This assignment requires you to make two processes (note: not threads) to demonstrate the
producer-consumer problem.
The producer will input a file of passwords and a number of passwords to transfer to the
consumer via shared memory at one time. It will also encrypt them using the algorithm
designed in Assignment three. Once it is done, it should use a semaphore to alert the
consumer that the passwords are ready.
The consumer will remove the passwords from shared memory, decrypt them, and store them
back to a file. For example if you have 10 passwords and move three at a time, the producer
will put in three, the consumer will remove three, producer puts in three, consumer removes
three, producer three, consumer 3, producer one, consumer 1. Once the consumer is done, it
should use a semaphore to alert the producer that the buffer is empty.

This is not a multithreaded project, so there should be no pthread creation.

The following arguments may be required when compiling on the command line:
g++ FILENAME -lrt -pthread -o ExeName.
You will have to run these files in two different terminals
Answered 1 days After Nov 13, 2022

Solution

Vikas answered on Nov 15 2022
50 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here