Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Psuedocode to to this in java would be helpful In this lab you will simulate scheduling in order to see how the time required depends
Psuedocode to to this in java would be helpful
In this lab you will simulate scheduling in order to see how the time required depends on the scheduling algorithm and the request patterns A process is characterized by just four non-negative integers A, B, C, and IO. A is the arrival time of the process and C is the total CPU time needed. A process execution consists of computation alternating with I/O. I refer to these as CPU bursts and I/O bursts To calculate CPU burst times we make the simplifying assumption that, for each process, the CPU burst times are uniformly distributed random integers (or UDRIs for short) in the interval (0, B]. To obtain a UDRI t in some interval (0, U] use the function randomOS(U) described below. So the next CPU burst is randomos (B. If the value returned by randonOS(B), ?s larger than the total CPU time remaining, set the next CPU burst to the remaining time Similarly, we assume the I/O times are UDRIs in the interval (0,IO] and hence the next I/O burst is randomOS (IO) You are to read a file describing n processes (i.e., n quadruples of numbers) and then simulate the n processes until they all terminate. The way to do this is to keep track of the state of each process (e.g., ready, running blocked) and advance time, making any state transitions needed. At the end of the run you first print an identification of the run including the scheduling algorithm used, any parameters (e.g. the quantum for RR), and the number of processes simulated You then print for each process o A, B, C, and IC Finishing time. . Turnaround time (i.e., finishing time - A). . I/O time (i.e., time in Blocked state) . Waiting time (i.e., time in Ready state) You then print the following summary data. . Finishing time (i.e., when all the processes have finished). . CPU Utilization (i.e., percentage of time some job is running). . I/O Utilization (i.e., percentage of time some job is blocked) Throughput, expressed in processes completed per hundred time units Average turnaround time Average waiting time. You must simulate each of the following scheduling algorithms, assuming, for simplicity, that a context switch takes zero time. You need only do calculations every time unit (e.g., you may assume nothing happens at time 2.5 RR with quantum 2 Uniprogrammed. Just one process active. When it is blocked, the system waits . SRTN (PSJF). This is preemptive. Recall that the remaining time is for the process, not the burst So the time you use to determine priority is the total time remaining (i.e., the input value C minus the number of cycles this process has run) For each scheduling algorithm there are several runs with different process mixes. A mix is a value of n In this lab you will simulate scheduling in order to see how the time required depends on the scheduling algorithm and the request patterns A process is characterized by just four non-negative integers A, B, C, and IO. A is the arrival time of the process and C is the total CPU time needed. A process execution consists of computation alternating with I/O. I refer to these as CPU bursts and I/O bursts To calculate CPU burst times we make the simplifying assumption that, for each process, the CPU burst times are uniformly distributed random integers (or UDRIs for short) in the interval (0, B]. To obtain a UDRI t in some interval (0, U] use the function randomOS(U) described below. So the next CPU burst is randomos (B. If the value returned by randonOS(B), ?s larger than the total CPU time remaining, set the next CPU burst to the remaining time Similarly, we assume the I/O times are UDRIs in the interval (0,IO] and hence the next I/O burst is randomOS (IO) You are to read a file describing n processes (i.e., n quadruples of numbers) and then simulate the n processes until they all terminate. The way to do this is to keep track of the state of each process (e.g., ready, running blocked) and advance time, making any state transitions needed. At the end of the run you first print an identification of the run including the scheduling algorithm used, any parameters (e.g. the quantum for RR), and the number of processes simulated You then print for each process o A, B, C, and IC Finishing time. . Turnaround time (i.e., finishing time - A). . I/O time (i.e., time in Blocked state) . Waiting time (i.e., time in Ready state) You then print the following summary data. . Finishing time (i.e., when all the processes have finished). . CPU Utilization (i.e., percentage of time some job is running). . I/O Utilization (i.e., percentage of time some job is blocked) Throughput, expressed in processes completed per hundred time units Average turnaround time Average waiting time. You must simulate each of the following scheduling algorithms, assuming, for simplicity, that a context switch takes zero time. You need only do calculations every time unit (e.g., you may assume nothing happens at time 2.5 RR with quantum 2 Uniprogrammed. Just one process active. When it is blocked, the system waits . SRTN (PSJF). This is preemptive. Recall that the remaining time is for the process, not the burst So the time you use to determine priority is the total time remaining (i.e., the input value C minus the number of cycles this process has run) For each scheduling algorithm there are several runs with different process mixes. A mix is a value of nStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started