Question
Write, test, and debug a program in Java (or any programming language you prefer) that contains two threads: Professor and StudentScheduler. The StudentScheduler thread will
Write, test, and debug a program in Java (or any programming language you prefer) that contains two threads: Professor and StudentScheduler. The StudentScheduler thread will create new Student objects at random intervals and place them in a shared memory queue of maximum length 5. Each Student object contains the Students name and the amount of time he/she needs to spend with the Professor. If the queue is full, the StudentScheduler thread will wait and not produce any more Students until there is a free spot in the queue. The Professor thread will remove Student objects from the queue and meet with each Student for the necessary length of time. If there are no Students in the queue, the Professor will play Halo on her computer until a new Student arrives. The Professor will leave and lock her office when there are no more Students to see for the day (she will know this because the StudentScheduler thread will terminate). The StudentScheduler thread will create a minimum of 15 and a maximum of 300 students.
Step 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