The Simulator essentially consists of Jobs, Devices, and Schedulers -- all coordinated by a
single loop of code.
• A Job is a customer of services: it is a process that needs to use system resources during its
• A Device represents a resource in the system. The devices available to a job are the CPU and
• You will also have a clock device and a pseudo-device that interrupts whenever a new job
arrives in the system.
• A Scheduler coordinates access to a device. It queues Jobs that are waiting to use a device
and will choose which job is the next to access.
The overall execution of the simulator occurs like this: Jobs arrive at the JobArrival device and
are entered into the system. A job's lifetime consists of alternating periods of using the CPU
(called a burst) and performing I/O. The Main Loop is responsible for moving jobs around the
system. It sends them to a scheduler, takes the next job from a scheduler, and starts and stops jobs
running on a device. The Disk Scheduler and the CPU Scheduler decide which job should be the
next to run on their respective devices. They also buffer jobs that are waiting to run but have not
yet been given access. The clock device is used to enable preemption.