Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment two: Program for FCFS Scheduling. Given n processes with their burst times, the task is to find average waiting time and average turnaround

Programming Assignment two:

Program for FCFS Scheduling.

Given n processes with their burst times, the task is to find average waiting time and average turnaround time using FCFS scheduling algorithm.

First in, first out (FIFO), also known as first come, first served (FCFS), is the simplest scheduling algorithm. FIFO simply queues processes in the order that they arrive in the ready queue.

In this, the process that comes first will be executed first and next process starts only after the previous gets fully executed.

Here we are considering that arrival time for all processes is 0.

How to compute below times in Round Robin using a program?

Completion Time: Time at which process completes its execution.

Turn Around Time: Time Difference between completion time and arrival time. Turn Around Time = Completion Time Arrival Time

Waiting Time (W.T): Time Difference between turnaround time and burst time.

Waiting Time = Turn Around Time Burst Time

In this example, we have assumed arrival times as 0, so turn around and completion times are same.

Important Points:

Non-preemptive

Average Waiting Time is not optimal

Cannot utilize resources in parallel: Results in Convoy effect (Consider a situation when many IO bound processes are there and one CPU bound process. The IO bound processes have to wait for CPU bound process when CPU bound process acquires CPU. The IO bound process could have better taken CPU for some time, and then used IO devices).

image text in transcribed

Using the programming environment of your choice, write and submit a program, (source code and output) to fully implement the above example.

Java please

oder FCFS (Example) Process Duration P1 | 24 P2 3 P3 4 1 Arrival Time 0 0 1 0 2 3 Gantt Chart: P1(24) P2(3) P3(4) P1 waiting time: 0 P2 waiting time: 24 P3 waiting time: 27 The Average waiting time: (0+24+27)/3 = 17 oder FCFS (Example) Process Duration P1 | 24 P2 3 P3 4 1 Arrival Time 0 0 1 0 2 3 Gantt Chart: P1(24) P2(3) P3(4) P1 waiting time: 0 P2 waiting time: 24 P3 waiting time: 27 The Average waiting time: (0+24+27)/3 = 17

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_2

Step: 3

blur-text-image_3

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

8. What steps can you take now to develop these skills?

Answered: 1 week ago

Question

Explain the causes of indiscipline.

Answered: 1 week ago

Question

The Nature of Nonverbal Communication

Answered: 1 week ago

Question

Functions of Nonverbal Communication

Answered: 1 week ago

Question

Nonverbal Communication Codes

Answered: 1 week ago