Three threads work together to transform a list of data. Thread producer generates a list of integer values and sends them to thread filter that removes all multiples of 10 and passes all other values to thread consumer that sorts them and displays them on the screen. Each of these threads perform their tasks at different speeds. The producer generates a value every 100 milliseconds, the filter processes a value every 500 milliseconds and the consumer continuously reads values. Using the BoundedBuffer class outlined in the lectures and listed in your book write a solution to this problem.
Write a program that uses condition variables to control access to a small auditorium in an art gallery. The auditorium has 20 seats and at most 20 people are allowed access at any one time. A person may choose any vacant seat to sit on. It should not be possible for two persons to lay claim to the same seat. However, the search for a seat to sit on should allow for optimal parallel activity.