|
|
Time |
(time/length) |
(time/length) |
Space (MSPACE) |
(BURSTS) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assume that a job is placed in the job queue as soon as it arrives. A job is loaded into memory as space in memory permits. Memory available for jobs is 4.0 Megabytes in units of 200K.
BURSTS gives the number of CPU bursts for a job; there is one less I/O burst. Each initial cpu or I/O burst for a job is as given in JFILE. Each subsequent CPU or I/O burst for a job is the same as the initial length plus a value selected randomly from the set [- 15, - 10, -5, 0, +5, +10, +15], or as your TA decides.
Jobs in the job queue are selected by the job scheduler for execution in FIFO order (but see below). The CPU scheduler selects jobs in the ready queue in FIFO order. An executing job cannot be preempted. Assume sufficient I/O processors to guarantee each job in memory its own I/O processor, so that there are no I/O queues.
A job can be loaded into memory for execution only if there is contiguous space for it. The required memory space for a job is given by MSPACE in JFILE. Fragmentation of memory is allowed, and once in memory, a job cannot be moved until job completion. The next job loaded from the job queue into memory is the first one in FIFO order that fits a vacant memory slot.
Write a simulation program to simulate
execution of the jobs. Assume about 20 jobs arriving and being executed,
and thus about 20 records in JFIILE. The following simplifying time allocation
assumptions should be used:
In addition, memory is compacted every time the 5th process terminates. Assume that compaction costs 0.2 per KB moved. For simplicity, you can assume that all the processes that are residing in memory are moved when compaction takes place.