Evaluate FCFS CPU Scheduling algorithm for given Problem Problem and Average Turn Around Time and Average Response Time
Process | P1 | P2 | P3 | P4 |
Process Time | 24 | 3 | 5 | 6 |
Given:
- Processes:
- P1: Burst Time = 24 ms
- P2: Burst Time = 3 ms
- P3: Burst Time = 5 ms
- P4: Burst Time = 6 ms
- Assumption: All processes arrive at the same time (0 ms), as no specific arrival time is provided.
Step 1: Process Execution Order
In FCFS scheduling, processes are executed in the order they arrive. Since all processes are assumed to arrive at the same time, they will be executed in the order they are listed.
Order of Execution:
P1 → P2 → P3 → P4
Step 2: Calculate Completion Time (CT), Turnaround Time (TAT), and Response Time (RT)
- Completion Time (CT): The time at which each process completes its execution.
- Turnaround Time (TAT): The total time taken from arrival to completion of a process.
- Response Time (RT): The time from the arrival of the process until it starts executing. Since in FCFS, a process starts execution immediately when the CPU is available, the response time is the same as the waiting time.
Execution and Calculations
Process | Burst Time (BT) | Start Time (ST) | Completion Time (CT) | Turnaround Time (TAT) | Response Time (RT) |
---|---|---|---|---|---|
P1 | 24 ms | 0 ms | 24 ms | 24 ms | 0 ms |
P2 | 3 ms | 24 ms | 27 ms | 27 ms | 24 ms |
P3 | 5 ms | 27 ms | 32 ms | 32 ms | 27 ms |
P4 | 6 ms | 32 ms | 38 ms | 38 ms | 32 ms |
Step 3: Average Turnaround Time and Average Response Time
Average Turnaround Time (TAT):
Average Response Time (RT):
- Order of Execution: P1, P2, P3, P4
- Average Turnaround Time: 30.25 ms
- Average Response Time: 20.75 ms
No comments:
Post a Comment