Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Java and LinkedList , will upvote, please answer asap. Only shortest job first (SJF) and Fair share scheduling. Class scheduler is already made.

Please use Java and LinkedList, will upvote, please answer asap. Only shortest job first (SJF) and Fair share scheduling.

Class scheduler is already made. Main and class are seperate. Please help with the code using the following initialization.

public static boolean SJF() is already under class scheduler, but I want the code to write in it and Main()

image text in transcribed

image text in transcribed

This programming assignment involves implementing several different process scheduling algorithms. The scheduler will be assigned a predefined set of tasks and will schedule the tasks based on the selected scheduling algorithm. Each task is assigned a priority and CPU burst. The following scheduling algorithms will be implemented: - First-come, first-served (FCFS), which schedules tasks in the order in which they request the CPU. - Shortest-job-first (SJF), which schedules tasks in order of the length of the tasks' next CPU burst. - Priority scheduling, which schedules tasks based on priority. - Round-robin (RR) scheduling, where each task is run for a time quantum (or for the remainder of its CPU burst). - Fair share scheduling, which schedules tasks based on their user and assigns each user the same time quantum for their tasks. Priorities range from 1 to 10 , where a higher numeric value indicates a higher relative priority. For round-robin scheduling, the length of a time quantum is 10 milliseconds. Calculate the average turnaround time, and waiting time for each of the scheduling algorithms. Fair share scheduling description The -share scheduling policy works as follow: Several users may exist in the system and each user may own several processes. In each scheduling cycle the scheduler distributes a predefined time quantum of CPU between different users and processes. At any scheduling cycle the scheduler distributes the time quantum equally between different users that have at least one process ready for execution. Furthermore, the scheduler distributes each user's time share equally between processes that belong to that user The order which the processes will be scheduled in one cycle is not important, i.e. there is no priority on users and processes. For this scheduler, the second column of the input represents the user id instead of the priority. Input The schedule of tasks has the form [task name] [priority or user_id] [CPU burst], with the following example format: T1,4,20 public class Schedulers \{ private static LinkedList task = Main.getTasks(); private static LinkedList priority = Main.getPriorities(); private static LinkedList burst = Main.getBursts (); private static LinkedList pidTask = new LinkedList ( task ); private static LinkedList turnaroundTime = new LinkedList(); private static LinkedList waitingTime = new LinkedList(); static LinkedList waitingQueve = new LinkedList (); private static int currentBurst =0

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

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

3. What are some examples of cultural gift-giving taboos?

Answered: 1 week ago