
Programming Project: Scheduling Algorithms
This project involves implementing several different process scheduling algorithms. The scheduler will be assigned a predefined set of tasks and will schedule the tasks based on the selected scheduling
- First-come, first-served (FCFS), which schedules tasks in the order inwhich they request the CPU.
- Shortest-job-first (SJF), which schedules tasks in order of the length of the tasks’ next CPU burst.
- Priority scheduling, which schedules tasks based on priority.
- Round-robin (RR) scheduling, where each task is run for a time quantum (or for the remainder of its CPU burst).
- Priority with round-robin, which schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority.
Priorities range from 1 to 10, where a higher numeric value indicates a higher relative priority. For round-robin scheduling, the length of a time quantum is 10 milliseconds.
I. Implementation
The implementation of this project has to be completed in C and program files supporting the project are provided in this repository. These supporting files read in the schedule of tasks, insert the tasks into a list, and invoke the scheduler.
The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format:
T1, 4, 20
T2, 2, 25
T3, 3, 25
T4, 3, 15
T5, 10, 10
Thus, task T1 has priority 4 and a CPU burst of 20 milliseconds, and so forth. It is assumed that all tasks arrive at the same time, so your scheduler algorithms do not have to support higher-priority processes preempting processes with lower priorities. In addition, tasks do not have to be placed into a queue or list in any particular order. There are a few different strategies for organizing the list of tasks, as first presented in Section 5.1.2. One approach is to place all tasks in a single unordered list, where the strategy for task selection depends on the scheduling algorithm. For example, SJF scheduling would search the list to find the task with the shortest next CPU burst. Alternatively, a list could be ordered according to scheduling criteria (that is, by priority). One other strategy involves having a separate queue for each unique priority, as shown in Figure 5.7. These approaches are briefly discussed in Section 5.3.6. It is also worth highlighting that we are using the terms list and queue somewhat interchangeably. However, a queue has very specific FIFO functionality, whereas a list does not have such strict insertion and deletion requirements. You are likely to find the functionality of a general list to be more suitable when completing this project.
II. C Implementation Details
The file driver.c reads in the schedule of tasks, inserts each task into a linked list, and invokes the process scheduler by calling the schedule() function. The schedule() function executes each task according to the specified scheduling algorithm. Tasks selected for execution on the CPU are determined by the pickNextTask() function and are executed by invoking the run() function defined in the CPU.c file. A Makefile is used to determine the specific scheduling algorithm that will be invoked by driver. For example, to build the FCFS scheduler, we would enter
make fcfs
and would execute the scheduler (using the schedule of tasks schedule.txt) as follows:
./fcfs schedule.txt
Before proceeding, be sure to familiarize yourself with the source code provided as well as the Makefile.
Completing this project will require writing the following C files:
- schedule_fcfs.c
- schedule_sjf.c
- schedule_rr.c
- schedule_priority.c
- schedule_priority_rr.c
Finally, keep versions of your code using Git. Also, don't forget to add a report about your project as a single .pdf file.
III. Submission
Submit your C files ( schedule_fcfs.c, schedule_sjf.c, schedule_rr.c, schedule_priority.c, schedule_priority_rr.c ) and a .pdf file as your report.
Create a 5 to 10 minutes video presentation in which you describe and run your codes. Upload it to Youtube as an unlisted video and add the link of your presentation to your report. Make sure you add your name and student id at the end of your report.

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps

- Discuss your project's CPU scheduling approaches.arrow_forwardBetween Preemptive and Non-Preemptive scheduling, which requires more time and action from the CPU? Why?arrow_forwardWhy do you think CPU scheduling is significant? And why is the algorithm used for scheduling different from the others?arrow_forward
- Discuss your project's CPU scheduling approaches.arrow_forwardAre there any additional reasons why you feel cpu scheduling is important? Why are there so many different scheduling algorithms?arrow_forwardReal-time Scheduling: Choose all true assertions. Rate Monotonic (RM) scheduling divides time into equal parts and requires each process to seek a portion upon starting. RM schedules real-time systems with CPU utilization below 1. When CPU utilization is less than 1, Earliest Deadline First (EDF) may schedule a real-time system. A process is initiated every p time unit. RM scheduling prioritizes shorter processes. EDF scheduling prioritizes processes with the shortest time frame.arrow_forward
- Calculate the waiting time and Turn Around Time (TAT) for each task and the average waiting time and turn around time (Assuming there is not input/output waiting for the task) if three task enters the 'Ready' queue with task ID T₁, T2, T3 with estimated completion time 10, 5, 8 milliseconds respectively. Tasks enter the 'Ready' queue in order Т2, Т1, Т3.arrow_forwardWhich facets of Shortest Job First Scheduling are similar to those of Priority Scheduling, and which are distinct?arrow_forwardPreemptive vs. non-preemptive scheduling: Which technique requires the most CPU time and effort?arrow_forward
- Why do you think cpu scheduling is important? and why does scheduling involves different algorithm?arrow_forwardBounded waiting requires that \A bound must exist on the number of times that other processes are allowed to enter their critical sections a) true b) falsearrow_forwardExercises - Scheduling Score: 7.8/20 3/10 answered Question 4 Using the priority list T4, T1, T7, T9, T8, T6, T2, T5, T3, schedule the project below with two processors. Task Time Required Tasks that must be completed first T1 6 T2 7 T3 9 T4 10 T1 T5 12 T1 T6 2 T2, T3 T7 6 T4, T5 T8 6 T5, T6 T9 11 T5, T6 Task 5 is done by Select an answer starting at time Task 8 is done by Select an answer starting at time The finishing time for the schedule is Progress 0.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





