Re: [Tutor] I'm attempting to code the barbershop problem...

2018-04-25 Thread Mats Wichmann
> What's the barbershop problem? a classic computer science puzzle which is essentially a process synchronization problem. it does help to spell out the problem you are trying to solve, however - we don't have the context the original poster is operating in.

Re: [Tutor] I'm attempting to code the barbershop problem...

2018-04-25 Thread Steven D'Aprano
Hi Michael and welcome. In future, please leave the Subject line as a BRIEF summary, and put the description of your problem in the body of the email. You said: > I'm attempting to code the barbershop problem in OS except > with 3 barbers instead of one. Can anyone help rewrite my Barber1 and >

[Tutor] I'm attempting to code the barbershop problem in OS except with 3 barbers instead of one. Can anyone help rewrite my Barber1 and Barber2 classes so it just uses the functions already defined i

2018-04-25 Thread Michael Solan
class Barber: barberWorkingEvent = Event() def sleep(self): self.barberWorkingEvent.wait() def wakeUp(self): self.barberWorkingEvent.set() def cutHair(self, customer): #Set barber as busy self.barberWorkingEvent.clear() print '{0} is having a haircut from barber\n'.format(customer.name) HairCutting