Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a program that simulates the service of jobs (process) by the CPU of a multi-user computer.The application must be written in C/C++ programming language

write a program that simulates the service of jobs (process) by the CPU of a multi-user computer.The application must be written in C/C++ programming language using data structure queue and linked list

1. Program should have command argument options to get input data from a text file and command argument option for write output data. -f must be used for command argument and following text indicate input file name and -o for output file name.

This file should have three columns and unlimited rows. It must be text and fields should delimit by : character. Below table represent structure of this file. Burst Time Arrival Time Priority 10 0 0 5 0 0

2. After first time executing simulator should ask for user to choose scheduling method. Menu should have at least four options

CPU Scheduler Simulator 1) Scheduling Method (None) 2) Preemptive Mode (Off) 3) Show Result 4) End Program Option >

Scheduling Method: In this mode program optain scheduling method from user. You should implement: None: None of scheduling method chosen First Come, First Served Scheduling Shortest-Job-First Scheduling Priority Scheduling Round-Robin Scheduling (You should also obtain time quantum value) b) Preemptive Mode: This is a clock-driven mode, in which the clock is a counter that is incremented each simulated second. The clock is initially 0, and continues "ticking" until all the jobs in the input have been serviced and left the system. This simmulation runs until a particular number of jobs have been serviced.

3)Non-preemptive Mode: In this mode dispatcher should make decision after running process was terminated. c) Show Result: If user chooses this option, program shows report to user from screen (As described Step 4). d) End Program: If user chooses this option, program show all (implemented) scheduling results on display (As described Step 4) and also write these results to output file that given with -o option and terminate simulator. e) Appendix section has screen and file outputs. Please create same output for your program. 4. Your program must gather statistics, compute, and report the following information: a) The average waiting time that all jobs spend in the wait queue. b) The waiting time that each job spends in the wait queue.

image text in transcribed

output.txt/Screen output Scheduling Method: Shortest Job First - Non-Preemptive Process Waiting Times: P1: 0ms P2: 10ms P3: 4ms P4: 13ms P5: 5ms Average Waiting Time: 6.4ms Scheduling Method: Shortest Job First -Preemptive Process Waiting Times: P1: 6ms P2: 10ms P3: 0ms P4: 13ms P5: 1ms Average Waiting Time: 6ms Scheduling Method: Priority Scheduling -Preemptive Process Waiting Times: P1: 14ms P2: 6ms P3: 0ms P4: 9ms P5: 1ms Average Waiting Time: 6ms

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions