ArticleDirectory
- Multi-reader queue
- Queuing at grocery stores
- Queuing at the airport
Multi-reader queue
Multi-reader queue is an extended asynchronous application.Program. To prove this, I will explain how to queue through two examples that everyone is familiar.
Queuing at grocery stores
Most grocery stores can add multiple queues. Each cashier has its own queue, so you need to select a queue to purchase certain items. If you are like me, most of the time you choose a queue with a full-loaded customer in front of you, he/she needs to check the price of many of the products they buy, in addition, you must use a third-party forward check for payment. Before it is your turn to settle the bill, customers who have not gone out of the queue may have already paid for the items they have purchased. This example illustrates a problem when multiple queues are used: if the previous task takes a long time to complete, the subsequent task cannot be processed in a timely manner.
Another major problem with using multiple queues is that after a queue is added, tasks need to be re-allocated between queues. Moving tasks back and forth before the queue may waste a lot of time. Taking the grocery store as an example, when a new cashier starts to work, imagine a crowd of customers pushing their cart.
Queuing at the airport
Although airlines are not an example of high efficiency, most ticket sites are more efficient than grocery stores because multiple ticket agents are serving a queue. Because there is only one queue, you do not have to worry about troubleshooting the queue. If a passenger takes a long time, other ticket agents can continue to serve other passengers (assuming there are multiple ticket agents ).
A queue with multiple readers can also be easily expanded. If the queue is too long, you can add a proxy without interrupting the queue. Some agents can also leave after receiving the current passenger, without causing confusion in the queue.