| 1. |
What are scheduling algorithms? Explain the FCFS Scheduling Algorithm. |
||||||||||||||||||||||||||||||||||||
|
Answer» CPU Scheduling is the process of determining which process will have exclusive use of the CPU while another is paused. The basic goal of CPU scheduling is to ENSURE that whenever the CPU is idle, the OS chooses at least one of the programmes in the ready queue to run. The CPU scheduler will be in charge of the selection process. It chooses from among the processes in memory that are ready to run. It simply solves the problem of selecting which of the outstanding requests should be given priority. Its FUNDAMENTAL goal is to alleviate resource scarcity while also ensuring justice among those who use the resources. In layman's terms, it is a method of allocating resources among multiple competing jobs. The various types of Scheduling Algorithms are as follows:
First Come First Serve Scheduling Algorithm: FCFS (First Come First Serve) is an operating system scheduling technique that executes processes in the order in which they arrive in the Ready Queue of the operating system. To put it another way, the process that comes first will be carried out first. Its nature is non-preemptive. If the burst time of the first process is the longest among all the jobs, FCFS scheduling may generate an issue of HUNGER. The time REQUIRED by the process for execution in MILLISECONDS is referred to as burst time. In comparison to other Operating System scheduling algorithms, it is also considered the easiest and simplest. The FIFO (First In First Out) queue is commonly used to handle FCFS implementation. Let us look at the FCFS Scheduling Algorithm with the help of an example. Let us assume that there are five processes with process IDs P0, P1, P2, P3, and P4 in the following given schedule. In the ready queue, P0 comes at time 0, P1 arrives at time 1, P2 arrives at time 2, P3 arrives at time 3, and Process P4 arrives at time 4. The processes are listed in the table below, along with their respective Arrival and Burst times.
The following formula is used to compute the turnaround time and the waiting time: Turn Around Time = Completion Time - Arrival Time Waiting Time = Turnaround time - Burst TimeThe average waiting time is calculated by adding all of the processes' respective waiting times and dividing the total by the total number of processes. Therefore we can say that the average Waiting time is 31/5 units = 6.2 units. Given below is the Gnatt Chart for the entire FCFS algorithm. |
|||||||||||||||||||||||||||||||||||||