A factory makes glass bottles.  A customer can place

A factory makes glass bottles.

 A customer can place an order for either 10 transparent or 10 painted bottles.

 There are glass blowers, painters and packers in the factory.

 As long as an order is not placed, no glass is blown.

 As long as a bottle is not blown, no bottle is painted.

 If the order is for transparent bottles, the painter does not work, and the bottles are passed to the packer.

 If the order is for painted bottles, the painter paints them and passes them on to the packer.

 The packer does not work as long as he does not receive bottles. The packer places 10 bottles in a crate, after which he tells the customer that the order is ready.

 The customer must not try to pick the order before it is ready.

 A new customer must not place order before the previous one picks his order.

 Insert necessary synchronization and mutual exclusion with semaphores in the given code. Do not forget to initialize them. You may use if-else structures. If you use them, place opening and closing brackets for them correctly.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top