Question

The burst times and start times of four processes A,B,C,D are as follows: Process Start Time...

  1. The burst times and start times of four processes A,B,C,D are as follows:

Process Start Time Burst Time

A 0   15

B   10 10

C   11 3

D   15 8

Show scheduling of the 4 processes using a Gantt chart for STCF. Compute the wait times for each process, and the average wait time, under STCF.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:-

SCTF - Shortest Time to Completion First.

SCTF-P = Pre-emptive version of SCTF.

STCF: run whatever job has the least amount of work to do before it finishes (or blocks for an I/O) .

Completion time : Time taken to complete a process.

Turnaround time : time from job submission to returned result.

Waiting time : total time spent waiting in the ready queue.

Given Information:

Procedure :

At starting time 0 Process A is in Ready Queue.

Here Starting time = 15.

At starting time 15 Process B, C, D are in Ready Queue.

According to rule of SCTF a Shortest Burst time Process should complete first.

In above 3 Processes C has shortest Burst time of 3 units.Therefore C should complete first.

Here Starting time = 18.

At starting time 18 Process B and D are in Ready Queue.

According to rule of SCTF a Shortest Burst time Process should complete first.

In above 3 Processes D has shortest Burst time of 8 units.Therefore D should complete first.

Starting time = 26.

Remaining Process is B having burst time 10 units.

Resulting Gantt Chart:

Calculating Completion Time of the Processes.Here CT(Pi) = Completion Time of the Process

CT(A) = 15

CT(B) = 36

CT(C) = 18

CT(D) = 26

Calculating TurnAround Time of the Processes.Here TAT(Pi) = CT(Pi) - ST(Pi).

TAT(A) = CT(A) - ST(A) = > 15 - 0 = 15

TAT(B) = CT(B) - ST(B) = > 36 - 10 = 26

TAT(C) = CT(C) - ST(C) = > 18 - 11 = 7

TAT(D) = CT(D) - ST(D) = > 26 - 15 = 11

Calculating Waiting Time of the Processes.Here WT(Pi) = TAT(Pi) - BT(Pi).

WT(A) = TAT(A) - BT(A) = 15 - 15 = 0

WT(B) = TAT(B) - BT(B) = 26 - 10 = 16

WT(C) = TAT(C) - BT(C) = 7 - 3 = 4

WT(D) = TAT(D) - BT(D) = 11 - 8 = 3

Calculating Average Waiting Time of the Processes.

Average Waiting Time = (WT(A)+WT(B)+WT(C)+WT(D)) / no.of processes.

                                => (0 + 16 + 4 + 3) / 4

                                => 23/4 = 5.75

Resulting Table:-

Add a comment
Know the answer?
Add Answer to:
The burst times and start times of four processes A,B,C,D are as follows: Process Start Time...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that the three processes arrived in order: Processes                            CPU Burst Time P1  &n

    Assume that the three processes arrived in order: Processes                            CPU Burst Time P1                                           17 P2                                            6 P3                                            8 a.     Please draw the Gantt chart if FCFS scheduling is used. b.    Please calculate the average waiting time and average completion time under FCFS. You MUST show the calculation procedure. c.      Please draw the Gantt chart if Round Robin is used. d.    Please calculate the average waiting time and completion time under RR with q = 3. You MUST show the calculation...

  • 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of...

    5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Burst time Arrival Time Process 3 P1 4 P2 2 10 P3 P4 (Note: a lower number means higher priority) Draw a Gantt chart showing a FCFS scheduling algorithm. a. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. c. Draw a Gantt chart showing a Round Robin Scheduling algorithm with quantum of 4ms d. Compute...

  • Opearting system 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the...

    Opearting system 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Process Arrival Time Burst time Priority P1 P2 P3 2 10 P4 (Note: a lower number means higher priority; processes P2- P4 arrive at the same time, in the given order) a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. Draw a Gantt chart showing...

  • Consider the following set of processes A, B, C, D with the following CPU burst time...

    Consider the following set of processes A, B, C, D with the following CPU burst time and I/O. Find the average waiting time with RR of quantum 10ms and context switch time=2ms. Draw the Gantt chart clearly and give necessary explanations. Process Arrival Time CPU Burst Time VO CPU Burst Time A 0 24 30 15 B 15 23 25 21 C 0 32 D 25 12

  • Given the following set of processes---with the specified length of the CPU burst, arrival time, and...

    Given the following set of processes---with the specified length of the CPU burst, arrival time, and priority---compute response time for P1-P5 with round-robin scheduling with time quantum of 10 units. Also compute average response time. Assume that a newly arriving process arrives first at time T- and a process that is preempted due to the completion of its quantum arrives at time T+ in the waiting queue. (Note: Show the Gantt chart and other working details in your worksheet.) Process...

  • The following processes are being scheduled using a pre-emptive, priority-based, round-robin scheduling algorithm. Process Burst Time...

    The following processes are being scheduled using a pre-emptive, priority-based, round-robin scheduling algorithm. Process Burst Time Priority Arrival 20 20 0 20 25 45 55 5 5 5 15 Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is pre-empted by a higher-priority process,...

  • Answer the following using the processes and their corresponding arrival time and burst time. These processes...

    Answer the following using the processes and their corresponding arrival time and burst time. These processes are being scheduled using a preemptive, round-robin scheduling algorithm with a time quantum of 2 units. PID Arrival Time Burst Time P1 0 4 P2 1 5 P3 2 3 P4 3 2 P5 4 6 1. Use a Gantt chart to represent the above processes (5 points) 2. Calculate the average waiting time for each process (5 points) 3. Calculate the completion time...

  • Please answer the following question in C++ language Consider the following set of processes, with the...

    Please answer the following question in C++ language Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1. 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive...

  • Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...

    Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process            Burst Time      Priority P1                    10                    3 P2                    1                     1 P3                    2                     3 P4                    1                     4 P5                    5                     2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF (SPN), a...

  • C language show all work 1. [50 pts] Given the following set of processes, with arrival...

    C language show all work 1. [50 pts] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Arrival Time Burst time Process P1 P2 P3 P4 4. 3 2 0 0 10 (Note: lower number means higher priority, processes P1, P2, P3, and P4 arrive at the same time, in the given order). a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT