Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Selected Examples

Priority Queues

Many types of models require that multiple classes of transactions be served by a single server. For example, two different types of customers arrive at an auto repair shop. One type needs only minor repairs, and the other type needs more major work. If one class has priority on getting service, then a priority queue is the appropriate modeling choice. Figure 9.5 shows one such model having two classes.

ex03.gif (6110 bytes)

Figure 9.5: A Priority Queue Example with Two Transaction Classes

The two classes of transactions arrive according to independent Poisson processes as represented by the two Samplers. Transactions travel to Modifiers that set the priority to be either a 1 or a 2. They then enter a Priority Queue with the priority level determining their position in the queue; the higher priority transactions are serviced before the lower priority transactions. When the transactions finish service, they enter a Switch that directs them to one of two Buckets as a function of priority class.

The model in Figure 9.5 assumes that if a Class 1 transaction is in service when a Class 2 transaction arrives, the Class 1 transaction completes service before the Class 2 transaction starts service ahead of any other Class 1 transactions in the queue. Figure 9.6 shows how you would modify the model if you wanted to pre-empt a Class 1 transaction that was in service when a Class 2 arrived.

ex03a.gif (9469 bytes)

Figure 9.6: A Priority Queue Example with Two Transaction Classes and Pre-emption

For this pre-emption, you would store the class of the transaction currently in service in a number holder. This storage is done by the trigger just below the number holder. Then, when a Class 2 transaction arrives, it causes a check of the class of the transaction in service. If it is Class 1, then it is pre-empted. Notice that any pre-empted Class 1 transactions are routed back into the queue.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.