This example shows jobs A, C and D are running on CPUs 1, 2 and 3 respectively at time 6. At time 7, D and C continue to

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

This example shows jobs A, C and D are running on CPUs 1, 2 and 3 respectively at time 6. At time 7, D and C continue to

Post by answerhappygod »

This example shows jobs A, C and D are running on CPUs 1, 2 and
3 respectively at time
6. At time 7, D and C continue to run on CPUs 1 and 2 respectively,
but CPU 3 is now idle.
Note: Be careful! You cannot start a job until it has arrived.
Also, CPUs are symmetric –
meaning it does not matter which job is on which CPU at a given
time! It is correct if at a
given time you are executing the right “set” of jobs. So, at time 6
we can have any ordering
of jobs A, D and C on CPUs 1, 2 and 3.
Write a C program that will read in job requests and print out the
corresponding job
schedule according to a Priority algorithm as above. The input
format is each line entry
contains a job separated by a tab. The first line of input is
ignored as the header. The output
format is two tables. First table is the running time and the job
currently executing (tab
separated). The second table is a summary with the user name (in
the order in which jobs
arrive) and the time when their last job is completed.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply