Question: 1. OBJECTIVE This assignment will introduce you to job scheduling. 2. SPECIFICATIONS Until the mid-seventies, most computers performed batch processing. There were fed batches of
1. OBJECTIVE
This assignment will introduce you to job scheduling.
2. SPECIFICATIONS
Until the mid-seventies, most computers performed batch processing. There were fed batches of jobs to be processed in sequence You are to simulate the execution of a such batch of jobs by an old computer with a single core, a disk drive, a print spooler and enough memory to hold MPL jobs at the same time, with MPL representing the multi- programming level of the system. Each job will be described by its job id followed by a deterministic sequence of deterministic resource requests.hese resources requests will consist of core requests (CORE), disk requests (DISK) and print spooler requests (PRINT). Your input will be a sequence of pairs as in:
MPL 2 // memory can hold 2 jobs
JOB 1// new Job
CORE 100 // request CORE for 100ms
Disk 0 // no wait access
CORE 30 // request CORE for 30ms
DISK 7// request DISK for 7ms
CORE 20 // Request Core for 20s
PRINT 1000// print spooler request
JOB 3// next job
CORE 30// request CORE for 30ms
All times will be expressed in milliseconds.
Running the simulation: The computer you will simulate will start processing its job batch by loading into memory the first MPL jobs of the batch and execute them in parallel. Each time, the computer is done with one of these jobs, its OS will load the next job into main memory and start processing it.
The CPU Queue: Your program should have a single ready queue holding all jobs waiting for the CPU and manage it in strict first come first served (FCFS) order. (These kinds of queues are better known as FIFO queues.)
The Disk Queue: Disk requests with a time parameter equal to zero represent data requests that do not result in any physical disk access. As a result, jobs executing these requests should immediately return to the ready queue without waiting for the disk. All other disk requests should go through a single disk queue that your program should manage in strict first come first served (FCFS) order.
The Spooler Queue: Your program should have a single spooler queue holding all jobs waiting for the print spooler and manage it in strict first come first served (FCFS) order.
Program Organization: Your program should read its input file name though input redirection as in:
./a.out < input.txt
Your program should have one process table with one entry per job containing its job id and its current state (RUNNING,READY or BLOCKED).
Since you are to focus on the scheduling actions taken by the system you are simulating, your program will only have to take action whenever
1. A job is loaded into memory,
2. A job completes a computational step.
All times should be simulated.
Each time a job starts or terminates your program should print a snapshot containing:
-
The current simulated time in milliseconds,
-
The job id of the job causing the snapshot, and the states of all other active jobs. (Jobs that have just been just loaded in main memory should be in the READY state.)
When all the jobs in your input stream have completed, your simulator should print a summary report listing:
-
The total simulation time in millisecond,
-
The number of jobs that have completed,
-
The total number of disk requests,
-
The CPU utilization, that is, the fraction of time that device was busy (between zero and one.
Input
PL 1 JOB 1 CORE 50 DISK 10 CORE 150 DISK 0 CORE 100 DISK 0 CORE 150 DISK 0 CORE 100 DISK 0 CORE 210 DISK 9 CORE 220 DISK 9 CORE 200 DISK 9 CORE 30 DISK 9 CORE 30 DISK 9 CORE 30 DISK 8 CORE 20 DISK 8 CORE 40 PRINT 400 CORE 200 PRINT 500 CORE 10 DISK 9 CORE 30 JOB 2 CORE 50 DISK 10 CORE 150 DISK 0 CORE 100 DISK 0 CORE 150 DISK 0 CORE 100 DISK 0 CORE 210 DISK 11 CORE 220 DISK 8 CORE 200 DISK 9 CORE 30 DISK 8 CORE 30 DISK 7 CORE 80 DISK 8 CORE 70 DISK 7 CORE 30 DISK 8 CORE 20 DISK 8 CORE 60 PRINT 600 CORE 200 PRINT 200 CORE 80 DISK 9 CORE 10 DISK 9 CORE 10 DISK 9 CORE 30 JOB 3 CORE 50 DISK 10 CORE 100 DISK 0 CORE 150 DISK 0 CORE 100 DISK 0 CORE 70 DISK 9 CORE 90 DISK 9 CORE 200 DISK 9 CORE 30 DISK 9 CORE 30 DISK 9 CORE 30 DISK 8 CORE 20 DISK 8 CORE 40 PRINT 400 CORE 200 PRINT 500 CORE 10 DISK 9 CORE 30 JOB 4 CORE 50 DISK 10 CORE 150 DISK 0 CORE 100 DISK 0 CORE 150 DISK 0 CORE 100 DISK 0 CORE 150 DISK 0 CORE 100 DISK 0 CORE 210 DISK 11 CORE 320 DISK 8 CORE 600 DISK 8 CORE 400 DISK 9 CORE 30 DISK 8 CORE 30 DISK 7 CORE 40 DISK 8 CORE 20 DISK 7 CORE 60 DISK 8 CORE 20 DISK 8 CORE 60 PRINT 500 CORE 20 PRINT 200 CORE 30 DISK 9 CORE 20 DISK 9 CORE 20 DISK 7 CORE 20
Please use C++ programming. Thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
