CS457 - System Performance Evaluation - Winter 2008
Questions and Comments
- Results midterm.
Lecture 20 - More Simulation Examples
Parallel servers: one queue, multiple servers
State variable is number-busy: m
How should it be updated and used?
- Initialized:
m = 0
- Updated on dequeue:
m++
- Updated on departure:
--m
- Tested:
if ( m < n-servers ) start-server;
Finite waiting room
Finite Population Model
Each user does
- Think
- Wait in queue
- Get service
- Think
- etc.
You might think that there are three event types
- Arrive
- Start service
- Depart
But, "start service" always coincides with either an arrive or a depart
event
One thing that is different:
- When does the next arrive event get put into the event set?
Tandem Queue
You saw this on the mid-term.
The principle is quite easy
- You just have M (number of servers) simulations
- The depart event of one is the arrive event of the next
but we would rather do this as one simulation. (Programming with signals
is not fun.)
The events in the event set are
- Arrive at 1 (A1)
- Depart from 1, 2, ..., M-1 (Dn)
- Depart from M (DM)
What happens for each?
- A 1.
- insert in Q1
- schedule next A1
- if S1 idle start-S1
- Dn
- Sn idle
- if (Qn not empty) start-Sn
- insert in Qn+1
- if (Qn+1 idle) start-Sn+1
- DM
- SM idle
- if (QM not empty) start-SM
- start-Sn
- Sn busy
- schedule Dn event
Processor Sharing
Time-slicing model: pre-emptive multi-tasking
For example, three classes of jobs
- Jobs with active I/O: long think times, very little processing
- Interactive jobs without active I/O: substantial processing that will
come to an end before long
- Batch jobs
Single server, three queues, needs a scheduling algorithm (discipline)
- Typical: try to provide some service to each
- Each queue has an importance, w(r), which means that it gets ... of the
processor (Exercise for the reader: Fill in ... in a reasonable way.)
Important state
- number of non-empty queues,
m
- number of jobs currently in each queue, N(r), r=1...M
Initialization
- The usual
- All queues empty
- One request (job) of each type in event-set
Arrival
- increment N(r)
- add request to queue
- if at head of queue,
- reschedule existing departure events
- start-service
Departure
- remove job from queue, decrement N(r)
- if N(r) == 0
- reschedule existing departure events
- else
Start-service
- work out departure time
- schedule departure event
Broadcast Delivery
Return to: