Question: ((( please guys all of these in java by using ubuntu ))) From what you have learned in lab, construct a multithreaded program to simulate

((( please guys all of these in java by using ubuntu )))((( 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. cocecoc-virtualBox: $ javac Main. java cocacoc-VLrtualBox: 5 java Matn Writing... number of renatinting unread Jobs in Buffer: 1 Reading.... number of renatining unread Jobs in Buffer: Writing... number of renatnting unread Jobs in Buffer: 1 Reading.... number of renatining unread Jobs in Buffer: Writing.... number of renaining unread Jobs in Buffer: 1 Reading.... number of renatinting unread Jobs in Buffer: 0 Writing... number of renatining unread Jobs in Buffer: 1 Reading.... number of renatining unread Jobs in Buffer: 0 Writing.... number of renatinting unread Jobs in Buffer: 1 Reading.... number of renatining unread Jobs in Buffer: Use the following main class and the sample output as a guide to complete the tasks above, Assignment group: Your choice of working by yourself or in groups of four. 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!