Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Submission : The source Java files for the classes in your program : A document file that includes your names & IDs plus a summary
Submission:
The source Java files for the classes in your program
: A document file that includes your names & IDs plus a summary explaining what you have done in your program formatted as follows,
Where the race condition is happening in the program and why, How you dealt with the race condition, Why and how the deadlock happened and how it was avoided.
The table below shows the tasks required along with the marks allocated for each task.
1 | The classes needed in the program |
1 | The operations on the shared object, Buffer |
1 | Dealing with Race Condition |
1 | Avoiding Deadlocks |
1 | Summary Report |
TOTAL 5 MARKS
((( please guys all of these in java by using ubuntu )))
From what you have learned in lab, construct a multithreaded program to simulate the print jobs of a printer, one job at a time, your program should include the following: - A shared object called a Buffer that is initially empty. - Set1 of threads, to put data in the buffer (Write Jobs) with 1/2 second delay. - Set2 of threads, to read data from the buffer (Read Jobs) with one second delay. - The Buffer should be empty upon exiting the program. - You should not allow reading jobs from the buffer if there is none existing. - You should not allow writing new jobs if the buffer is full (say have a maximum of 20 jobs) - Deal with race conditions. - Avoid deadlocks. Use the following main class and the sample output as a guide to complete the tasks aboveStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started