Develop a multithreaded producer and consumer application. Add 15 strings of various length (5 characters or more) to the buffer.

Java HOMEWORK 3

Develop a multithreaded producer and consumer application. The producer will add 15 strings of various length (5 characters or more) to the buffer. You can hardcode 15 strings of arbitrary length (5 characters or more) in the producer class. You need to create one producer thread.

Consumer is going to read each string from the buffer and calculate the length of the string and reverse the string after reading. Consumer will display the length of each string and each of the reversed string as well. You need to create three consumer threads.

Note: You should use 4 separate color for each thread. You should use ReentrantLock for synchronization among producer thread and 3 consumer threads.

You should name your project HW3. Make sure to include relevant project files and place all the files in a folder named “Your Last Name_Your UTAID” and upload the zipped folder to Canvas

 

Develop a multithreaded producer and consumer application. Add 15 strings of various length (5 characters or more) to the buffer.
Scroll to top