I am trying to write a monitor solution for the sleeping barber problem using two barbers and customers of three types who are either waiting solely for barber 1, barber 2 or may not care which barber cuts their hair.
I was hoping for guidance on this problem -
My thoughts so far are that the algorithm will utilize a single list for the waiting customers and can use procedures such as
try_to_get_haircut()
if_not_first()
wake_up_barber()
wait_for_haircut()
Below is one barber solution and i hope it'll guide for you.