![]() ![]() Understand the differences and design of those synchroniation primitivesĬ program: Two templates, You can choose which ever one you want. (atleast 3 barbers).Īble to correctly use the synchronization primitives to solve the classic synchronization problems.Īble to program using the synchronization primitives Mandatory: simulate the case of multiple barbers.Write a program to simulate the scenario described above. In the picture below, we show the case of 3 barbers. If some barbers are sleeping, the custom will wake the barber up and sit into his chair. When all the barbers are busy, the customer need to wait in the waiting room. ![]() If there are no other customers waiting, he returns to his chair and sleeps in it.Ĭustomers will come into the barber shop in a random manner. If there are, he brings one of them back to the chair and cuts his hair. ![]() When the barber finishes cutting a customer's hair, he dismisses the customer and then goes to the waiting room to see if there are other customers waiting. Each barber has one barber chair and a waiting room with a number of chairs in it. Assume we have a barber shop with m barbers. We will work on the famous Barber Shop problem. In this lab, you need to show the ability to use either mutex, conditional variables, or semaphores to solve problems. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |