In the pseudocode below, if there is only one customer and one waiter, insert wa
ID: 3552411 • Letter: I
Question
In the pseudocode below, if there is only one customer and one waiter, insert wait and signal calls to coordinate the steps to occur in the order given. Customer Waiter 1_Give_order() 2_Take_order() 3_Serve_meal() 4_Eat_meal() 5_Request_check() 6_Give_check() 7_Pay 8_Take_payment()
Explanation / Answer
1_Give_order() ------->signal() (give the order) 2_Take_order() ------------->wait() ( take the order if the waiter is free) 3_Serve_meal() 4_Eat_meal() 5_Request_check() ----------->signal() (request for check) 6_Give_check() ------------->wait() (check granted) 7_Pay ------------->signal() (pay the bill) 8_Take_payment() ------------->wait() (take paymeny when cash counter is free)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.