Question: By java language I need the code in java Exercise 1: You should use the CyclicBarrier class (5 Marks) 1. Create a class Customer by

By java language
I need the code in java
Exercise 1: You should use the CyclicBarrier class (5 Marks) 1. Create a class Customer by extending the abstract class Thread. This class contains 2 attributes: name and a cyclic barrier. Create a parametrized constructor. 2. Override the method run by defining the behavior of a customer in one restaurant. Each customer will eat 3 dishes (starter, main dish and dessert). Each customer should wait until all his friends finish eating the current dish. All the customers, in the same table, will leave the restaurant together in the end of the 3 dishes. 3. Define a main method with 3 customers. Exercise 2: (5 Marks) 1. Create a monitor class to manipulate a bounded buffer containing 2 methods write (adding a String in the buffer) and read (taking a String from the buffer). 2. Create a producer thread and consumer thread using the Tread interface. ITSW3104 Concurrent Programming Page 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
