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...


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





Nov 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here