Question: anyone can help with this programming assignment and teach me how to work on jBaci ? Bounded Buffer producer/consumer: In this programming assignment you have
anyone can help with this programming assignment and teach me how to work on jBaci ?
Bounded Buffer producer/consumer:
In this programming assignment you have to implement the bounded buffer producer-consumer using the jBaci environment. The specifications are:
Buffer size: 4
Producer will iterate 20 times.
Consumer will iterate 20 times.
Produce item: To produce an item you have to initialize a variable, say x = 0; then in each iteration x is incremented by one therefore the generated items will be: 1 in he first iteration, 2 in the second iteration, 3 in the third iteration, and so on. Each time an item is inserted in buffer, the program must print: "item k placed into buffer"
Consume item: multiply by 10 the value got from buffer and create a dummy loop that iterates from 1 to item x 10 and then write " item j was taken from buffer"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
