I'm programming a restaurant simulation in C++ to gain practice in the language, especially C++11 threads.
I intend on using a threaded server class (i.e a waiter) that can do the following:
receive notification of a new job being posted to a global table and take on the job (i.e seat a party that has just entered the restaurant)
receive notification of a party that is ready to place an order and take on the job (i.e visit the party's table, take their order and submit it to either the bar or kitchen's job queue)
receive a notification when an order is complete, taking the order from either the kitchen or bar and delivering it to the correct table
The big problem here is that my desired behavior is similar to waiting on several condition variables at the same time, which I have read is not possible from this post.
I would prefer to not use busy waiting, as these tasks could take up to a few minutes or more and that is a lot of unnecessary CPU consumption.
Most likely, I am thinking that I will want to employ some combination of condition variables and boost signals, but I am unsure of how I might design this to be most effective and concise.
Any suggestions on design or reading are highly appreciated.
Thanks in advance!