0
0
Operating Systemsknowledge~30 mins

Scheduling criteria (turnaround time, waiting time, throughput) in Operating Systems - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Scheduling Criteria: Turnaround Time, Waiting Time, and Throughput
📖 Scenario: You are managing a small computer system that runs several tasks. Each task has a specific time it needs to run (burst time). You want to understand how well your system schedules these tasks by calculating key performance measures.
🎯 Goal: Build a simple data structure to hold task details, set a total time limit, calculate turnaround time, waiting time, and throughput for the tasks, and finalize the summary of these scheduling criteria.
📋 What You'll Learn
Create a dictionary with task names as keys and their burst times as values.
Add a variable for the total time available for processing tasks.
Calculate turnaround time and waiting time for each task using a simple scheduling order.
Calculate throughput as the number of tasks completed per unit time.
Summarize the scheduling criteria in a final dictionary.
💡 Why This Matters
🌍 Real World
Scheduling criteria like turnaround time, waiting time, and throughput help system administrators and developers understand how efficiently a computer system handles multiple tasks.
💼 Career
Knowledge of scheduling criteria is essential for roles in system administration, software development, and performance engineering to optimize resource use and improve user experience.
Progress0 / 4 steps
1
DATA SETUP: Create the tasks dictionary
Create a dictionary called tasks with these exact entries: 'Task1': 4, 'Task2': 3, 'Task3': 2, 'Task4': 1 representing the burst time for each task.
Operating Systems
Need a hint?

Use curly braces to create a dictionary with task names as keys and numbers as values.

2
CONFIGURATION: Set the total available time
Add a variable called total_time and set it to 10 representing the total time available to run all tasks.
Operating Systems
Need a hint?

Just create a variable and assign the number 10 to it.

3
CORE LOGIC: Calculate turnaround time and waiting time
Create two dictionaries called turnaround_time and waiting_time. Use a variable elapsed starting at 0. For each task in the order Task1, Task2, Task3, Task4, calculate turnaround time as elapsed + burst time and waiting time as elapsed. Update elapsed by adding the current task's burst time after each calculation.
Operating Systems
Need a hint?

Use a for loop over the list of tasks in order. Keep track of elapsed time and update both dictionaries inside the loop.

4
COMPLETION: Calculate throughput and summarize criteria
Create a variable called throughput as the number of tasks divided by total_time. Then create a dictionary called scheduling_summary with keys 'Turnaround Time', 'Waiting Time', and 'Throughput' holding the respective dictionaries and value.
Operating Systems
Need a hint?

Count the tasks with len(tasks) and divide by total_time. Then create a dictionary with the three keys and their values.