Question: This assignment addresses the implementation of CPU-scheduling algorithms in an operating system. Each process in an operating system is managed by using a data structure

This assignment addresses the implementation of CPU-scheduling algorithms in an operating system.

Each process in an operating system is managed by using a data structure called the Process Control Block (PCB). A PCB contains the process ID, arrival timestamp, total burst time, execution start time, execution end time, remaining burst time and the priority of the process in the system. The PCB class is defined as follows and is accessible from the rest of the code in this project:

public class PCB {

public int processID;

public long arrivalTimeStamp;

public long totalBurstTime;

public long executionStartTime;

public long executionEndTime;

public long remainingBurstTime;

public int processPriority;

}

The set of processes in the operating system that are ready to execute are maintained in a data structure called the Ready Queue. This data structure is a List of PCBs of the processes that are waiting for the CPU to become available so that they can execute.

To determine the schedule of execution for the processes in an operating system, we consider three policies:

1. Priority-based Preemptive Scheduling (PP)

2. Shortest-Remaining-Time-Next Preemptive Scheduling (SRTP)

3. Round-Robin Scheduling (RR)

In order to implement the above policies, we need to develop methods that handle arrival of processes for execution and the completion of process execution. Whenever a process arrives for execution, it can either join the ready queue and wait for its chance to execute or execute immediately (if there is no other process currently executing or if the currently-running process can be preempted). Whenever a process completes execution, another process from the ready queue is chosen to execute next, based on the scheduling policy. The details of these methods are described below in the specification and you need to develop code for these methods that follows the specification

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!