Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

that has used one-fourth of its time quantum goes to a place one-fourth of the d

ID: 3639716 • Letter: T

Question

that has used one-fourth of its time quantum goes to a place one-fourth of the distance away from the beginning of the queue. What is the objective of this scheduling policy? Discuss the advantage and disadvantage of its implementation. In a single-user dedicated system, such as a personal computer, it's carry for the user to determine when a job is caught in an infinite loop. The typical solution to this problem is for the user to manually intervene and terminate the job, What mechanism would you implement in the Process Scheduler to automate the termination of a job that's in an infinite loop? Take into account jobs that legitimately use large amounts of CPU times for example, one "finding the first 10,000 prime numbers." Some guidelines for selecting the right time quantum were given in this chapter. As a system designer, how would you know when you have chosen the best time quantum? What factors would make this time quantum best from the user's point of view? What factors would make this time quantum best from the system's point of view? Using the process state diagrams of Figure 4.2, explain why there's no transition From the READY state to the WAITING state From the WAITING state to the RUNNING state Write a program that will simulate FCPS, SJN, SRT, and round robin scheduling algorithms. For each algorithm, the program should compute waiting time and turnaround time of every job as well as the average waiting time and average turnaround time. The average values should be consolidated in a table for easy comparison. You may use the following data to test your program. The time quantum for round robin is 4 milliseconds and the context switching time is 0.

Explanation / Answer

This program is to perform FCFS. #include #include using namespace std; int main() { char p[30][30]; //process name float at[30]; //arrival time float bt[30]; //cpu cycles float tat[30]; //turn around time float wt[30]; //waiting list float atat=0,avg=0; //average turn around time and average time int n; //number of processes //temporary variables int i,j,b=0; float temp1; char temp2[30]; //input cout > n; for(i=0;i