Problem

Round-robin (RR) is a simple scheduling algorithm for processes using the CPU. Each proces...

Round-robin (RR) is a simple scheduling algorithm for processes using the CPU. Each process is given a slice of time on the CPU in equal portions and in circular order. The algorithm assumes that we know the burst time for each process—this is the amount of dme that the process needs the CPU before the next I/O request.

a. Design an ADT to represent a process. Each process has an id and keeps track of the burst time.

degree head coeff power next

FIGURE 5-34

A sparse polynomial

b. Design an ADT that keeps track of a group of processes using the CPU with round-robin scheduling. Use a circular linked list as the data structure that keeps track of the processes wanting to use the CPU. Run the schedule by traversing through the list, simulating each process getting a slice of the CPU, assuming that the process gets a 100 millisecond time slice, and that its burst time is then reduced by 100 milliseconds. Bach time the process has the CPU, print to the console the process id and burst time remaining after the process uses the CPU. If a process completes execution (on its last time slice it has 100 milliseconds or less), remove it from the list. When the list of processes is empty, the schedule is complete.

c. Write a test program that demonstrates your ADT completely. Your program should try many different scenarios—for example, the process with the shortest burst time first, all the processes with the same burst time, and processes widi burst times that are not multiples of 100 milliseconds.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT