Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

it says in the code 8 README.md * Rbook.bt This thing involves Implementing (1.c., simulating several different process scheduling algorithms. 6 The scheduler will be

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
it says in the code
8 README.md * Rbook.bt This thing involves Implementing (1.c., simulating several different process scheduling algorithms. 6 The scheduler will be assigned a predefined set of tasks and will schedule the tasks based on the selected scheduling 7 algorithm. Each task is assigned a priority and CPU burst. The following scheduling algorithms will be implemented: 9. First-come, first-served (FCFS), which schedules tasks in the order in which they request the CPU. 10. Shortest-job-first (S3F), which schedules tasks in order of the length of the tasksie next CPU burst. 11. Priority scheduling, which schedules tasks based on priority. 12. Round-robin (cc) scheduling, where each task is run for time quantum (or for the remainder of its CPU burst). 13* Priority with round-robin, which schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. 15 Priorities range from 1 to 10, where a higher numeric value indicates a higher relative priority. 16 For pr scheduling, the length of a time'quantun' is 10 milliseconds. 27 1898 Implementation 19 The Implementation of this project may be completed in and program files supporting the project are 20 provided in the Startkit-Code folder. These supporting Files read in the schedule of tasks, 21 insert the tasks into a list, and invoke the scheduler. The schedule of tasks has the form 22 [task nae] priority][CPU burst], with the following example format: 23 24 Ti, 4, 20 25 T2, 2, 25 T3, 3, 25 27 T4, 3, 15 28 TS, 10, 10 29 30 Thus, task T1 has priority and a CPU burst of 20 m111 seconds, and so forth. It is assumed that all tasks arrive at Ji the same time, so your scheduler algorithms do not have to support higher-priority processes preempting processes with 32 lower priorities. Tasks must be placed into a queue or list in the order they appear in the Input. 34 There are a few different strategies for organizing the lot of tanko, . first presented in Section 5.1.2. One approach 35is to place all tasks in a single unordered list, where the strategy for task selection depends on the scheduling 36 algorithm. For example, SF scheduling would search the list to find the task with the shortest next CPU burat. 37 Alternatively, list could be ordered according to scheduling criteria (that is, by priority). One other strategy 38 involves having a separate queue for each unique priority. Shown in Figure 5.7. These approaches are briefly 39 discussed in Section 5.3.6. It is also worth highlighting that we are using the terms list and queue sonewhat 40 interchangeably. However, . queue has very specific FIFO functionality, whereas list does not have such strict 41 insertion and deletion requirements. You are likely to find the functionality of a general list to be more suitable 42 when completing this project. 44 Processes should be run in the order they appear in the input. Processes with equal priorities or burst times should be Witable 26 *README.md X book.txt 44 Processes should be run in the order they appear in the input. Processes with equal priorities or burst times should be 45 executed in the order they appear in the input. This applies to ties that may arise during 53F, Priority or Priority 46 with round-robin scheduling (see example output below). 47 484 Implementation Details 49 The file driver.creads in the schedule of tasks, inserts each task into a linked list, and invokes the process se scheduler by calling the schedule() function. The schedule() function executes each task according to the specified 51 scheduling algorithm. Tasks selected for execution on the CPU are determined by the pickNext Task() function and are 52 executed by invoking the 'run() function defined in the CPU.c' file. A "Makefile is used to determine the specific 53 scheduling algorithm that will be invoked by driver. For example, to build the FCFS scheduler, we would enter: 54 55 make fcfs 56 and would execute the scheduler (using the schedule of tasks 'schedule.txt') as follows: 57 ./fcfs schedule.txt 59 Before proceeding, be sure to familiarize yourself with the source code provided as well as the Makefile. 61. Example output 63 Consider the following input: 58 62 64 65 66 67 68 69 70 71 72 23 74 75 76 77 78 79 80 81 82 83 Pe, 9. 35 P1, 10, 25 P2, 7, 40 P3, 6, 20 P4, 10, 40 P5, 4, 35 P6, 10, 20 P7, 3, 35 PS, 3, 30 P9, 4, 38 P10, 4, 35 P11, 8, 20 P12, 4, 20 P13, 5, 15 P14, 7. 10 P15, 1, 25 P16, 8, 25 P17, 6, 30 P18. 2. 48 Writable Insert 120:47:5709 *README.md X book.txt 83 P18, 2, 40 84 P19, 3, 20 85 P20, 9, 10 86 P21, 7, 5 87 P22, 6, 35 88 P23, 3, 40 89 P24, 9, 30 90 91 92 93 Output of the priority scheduling algorithm is given below. 94 95 96 Running task = [P1] [10] [25] for 25 units 97 Running task = [P4] [10] [40] for 48 units 98 Running task = [P6] [10] [20] for 20 units 99 Running task = [PO] [9] [35] for 35 units lee Running task = [P20] [9] [10] for 10 units 101 Running task = [P24] [9] [30] for 30 units 102 Running task = [P11] [8] [20] for 20 units 103 Running task = [P16] [8] [25] for 25 units 104 Running task = [P2] [7] [40] for 48 units 105 Running task = [P14] [7] [10] for 10 units 106 Running task = [P21] [7] [5] for 5 units 107 Running task = [P3] [6] [20] for 20 units 108 Running task = [P17] [6] [30] for 30 units 109 Running task = [P22] [6] [35] for 35 units 110 Running task = [P13] [5] [15] for 15 units 111 Running task = [P5] [4] [35] for 35 units 112 Running task = [P9] [4] [30] for 30 units 113 Running task = (P10) [4] [35] for 35 units 114 Running task = [P12] [4] [20] for 20 units 115 Running task = (P7] [3] [35] for 35 units 116 Running task = [P8] [3] [30] for 38 units 117 Running task = (P19] [3] [20] for 20 units 118 Running task = [P23] [3] [40] for 40 units 119 Running task = (P18] [2] [40] for 40 units 12 Running task = (P15] [1] [25] for 25 units 121 122 Average waiting time = 306.40 LI README.md book. 122 Average waiting time - 386.40 133 Average turnaround time = 333.20 Average response time = 306.40 126 Note 11. For round-robin er priority with round-robin algorithms, the burst time should be the remaining burst time each run of the process. For example, consider the following output for Pe under round-robin: 132 Running task = [PO] [91 [35] for 30 units 131 Running task - (0) (0) (25) for 10 units 132 Running task = (poj (9) (15) for 10 units 133 Running task - (0) (0) (5) for 5 units 234 135 **Note 2Here we don't provide the correct outputs for other algorithms which is intentional as it will deepen your understaning of the way these algorithe work. 136 131 131 140 Deliverables completing this project will require writing the following them, which invoke the appropriate scheduline 143 algorithm 145 schedule of 145 schedule, 38 147 scheduler. 248 schedule_priority. 11 schedule_priority.jr.c 150 1852. And calculating the verwy** ***uenced, haiting time, and response the formach of the above scheduling algorithe 157 1933. You need to suit on the the projecte that includes the starter code (even if it was not modified), 114 Heffle and any source files that are added. Do not salt object (..) ile or compiled executables. IN 156 Evaluation 187 Correct implementation of each algorithm will get 4 marks which make a total of 20 market for project. The 4 men for each for the libre as follow 3383. Correct output (the order and well 2.5 points 1. One incorrect line 0.5 point 2. Two incorrect lines 1 point rate Insanlar I will 11204715 incent 357 Correct implementation of each algorithm will get 4 marks which make a total of 20 marks for project 2. The 4 marks for each algorithm is broken down as follows 1581. Correct output (the order and values): 2.5 points 159 1. One incorrect line: -0.5 point 160 2. Two incorrect lines -1 point 161 . Duplicate lines: -0.5 point 262 4. Three or more lines of mistakes: -2.5 2632. Correct Average waiting time: 0.5 point 1643. Correct Average turnaround time 0.5 point 1654. Correct Average response time 0.5 point I writable mert 1204715708 *README.md book.txt x 1 P1, 4, 5 2 P2, 1, 3 3 P3, 2, 1 4P4, 2, 7 5P5, 3, 4 61 CPU - Notepad File Edit Format View Help "Virtual" CPU that also maintains track of system time. #include #include "task.h" 1/ run this task for the specified time slice void run(Task task, int slice) { printf("Running task - [%] [d] [%d] for %d units ", task->name, task->priority, task-burst, slice); ) cpu.h - Notepad File Edit Format View Help 1/ length of a time quantum #define QUANTUM 10 // run the specified task for the following time slice void run(Task *task, int slice); driver - Notepad File Edit Format View Help * Driver.c Schedule is in the format [name] [priority] (CPU burst] */ #include #include #include #include "task.h" #include "list.h" #include "schedulers.h" #define SIZE 100 int main(int argc, char *argv[]) { FILE *in; char *temp; char task[SIZE]; char *name; int priority; int burst; in = fopen(argv[1],"r"); in = fopen(argv[1],"r"); while (fgets (task, SIZE,in) != NULL) { temp = strdup(task); name = strsep(&temp,", "); priority = atoi(strsep(&temp, ",")); burst = atoi(strsep(&temp.",")); // add the task to the scheduler's list of tasks add(name, priority, burst); free (temp); } fclose(in); // invoke the scheduler schedule(); return 0; } in 1 Col1 100% Unix list - Notepad File Edit Format View Help - Various list operations / #include #include #include #include "list.h" #include "task.h" // add a new task to the list of tasks void insert(struct node **head, Task *newTask) { 77 add the new task to the list struct node *newNode = malloc(sizeof(struct node)); newNode->task = newTask; newNode->next = *head; *head = newNode; 3 // delete the selected task from the list void delete(struct node **head, Task *task) { struct node *temp; struct node *prev; P ite temp "head; // special case beginning of list if (strcmp(task->name, temp->task->name) == 0) { head = ("head) ->next; } else { // interior or last element in the list prev = head; temp = temp->next; else { // interior or last element in the list prev = "head; temp = temp->next; while (strcmp(task->name, temp->task ->name) != 0) { prev = temp; temp = temp->next; } prev->next = temp->next; I raverse the list traverse(struct node "head) { struct node *temp; temp = head; RP 0 it while (temp != NULL) { printf("[%] [%d] [%d] ", temp->task->name, temp->task->priority, temp->task->burst); temp = temp->next; Der Porjed in 1. Col 1 100% Unix (LP) UTF 8 list - Notepad File Edit Format View Help \** * list data structure containing the tasks in the system */ #include "task.h" struct node { Task *task; struct node *next; }; // insert and delete operations. void insert(struct node **head, Task *task); void delete(struct node **head, Task *task); void traverse(struct node *head); README.md book.txt Makefile * 1 makefile for scheduling program 2# 3# make rr - for round-robin scheduling 4# make fcfs - for FCFS scheduling 5# make sjf - for SJF scheduling 6# make priority - for priority scheduling 7# make priority_rr - for priority with round robin scheduling 8 9 CC=CC 10 CFLAGS=-Wall 11 12 clean: 13 rm -rf *.0 14 rm -rf fcfs 15 rm -rf sjf 16 rm -rf mr 17 rm -rf priority 18 rm -rf priority_rr 19 2err: driver.o list.o CPU.O schedule_rr.o 21 $(CC) $(CFLAGS) -o rr driver.o schedule_rr. list.o CPU. 22 23 sif: driver.o list.o CPU.O schedule_sjf.o 24 $(CC) $(CFLAGS) -o sjf driver.o schedule_sjf.o list.o CPU.O 25 26 fcfs: driver.o list.o CPU.O schedule_fcfs.o 27 $(CC) $(CFLAGS) -o fcfs driver.o schedule_fcfs.o list.o CPU.O 29 priority: driver.o list.o CPU.O schedule_priority.o $(CC) $(CFLAGS) -o priority driver.o schedule_priority.o list.o CPU.O 31 32 schedule_fcfs.o: schedule_fcfs.c 33 $(CC) $(CFLAGS) - schedule_fcfs.c 28 30 34 36 37 35 priority_rr: driver.o list.o CPU.O schedule_priority_rr.o $(CC) $(CFLAGS) -o priority_rr driver.o schedule_priority_rr.o list.o CPU.O 38 driver.o: driver.c 39 $(CC) $(CFLAGS) -c driver.c 40 Writable pri-schedule.txt * x 1T1, 1, 50 2 T2, 1, 50 3 T3, 1, 50 4 T4, 1, 50 5 T5, 1, 50 6 T6, 1, 50 rr-schedule.txt X pri-schedule.txt 1|11, 4, 50 2 T2, 4, 50 3 T3, 4, 50 4 T4, 4, 50 5 T5, 4, 50 6 T6, 4, 50 7 schedule.txt x 1111, 4, 20 2 T2, 3, 25 3 T3, 3, 25 4 T4, 5, 15 5 T5, 5, 20 6 T6, 1, 10 717, 3, 30 8 T8, 10, 25 9 schedulers - Notepad File Edit Format View Help #define MIN_PRIORITY 1 #define MAX_PRIORITY 10 // add a task to the list void add(char *name, int priority, int burst); // invoke the scheduler void schedule(); task - Notepad File Edit Format View Help /** Representation of a task in the system. */ #ifndef TASK_H #define TASK_H // representation of a task typedef struct task { char *name; int tid; int priority; int burst; } Task; #endif 8 README.md * Rbook.bt This thing involves Implementing (1.c., simulating several different process scheduling algorithms. 6 The scheduler will be assigned a predefined set of tasks and will schedule the tasks based on the selected scheduling 7 algorithm. Each task is assigned a priority and CPU burst. The following scheduling algorithms will be implemented: 9. First-come, first-served (FCFS), which schedules tasks in the order in which they request the CPU. 10. Shortest-job-first (S3F), which schedules tasks in order of the length of the tasksie next CPU burst. 11. Priority scheduling, which schedules tasks based on priority. 12. Round-robin (cc) scheduling, where each task is run for time quantum (or for the remainder of its CPU burst). 13* Priority with round-robin, which schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. 15 Priorities range from 1 to 10, where a higher numeric value indicates a higher relative priority. 16 For pr scheduling, the length of a time'quantun' is 10 milliseconds. 27 1898 Implementation 19 The Implementation of this project may be completed in and program files supporting the project are 20 provided in the Startkit-Code folder. These supporting Files read in the schedule of tasks, 21 insert the tasks into a list, and invoke the scheduler. The schedule of tasks has the form 22 [task nae] priority][CPU burst], with the following example format: 23 24 Ti, 4, 20 25 T2, 2, 25 T3, 3, 25 27 T4, 3, 15 28 TS, 10, 10 29 30 Thus, task T1 has priority and a CPU burst of 20 m111 seconds, and so forth. It is assumed that all tasks arrive at Ji the same time, so your scheduler algorithms do not have to support higher-priority processes preempting processes with 32 lower priorities. Tasks must be placed into a queue or list in the order they appear in the Input. 34 There are a few different strategies for organizing the lot of tanko, . first presented in Section 5.1.2. One approach 35is to place all tasks in a single unordered list, where the strategy for task selection depends on the scheduling 36 algorithm. For example, SF scheduling would search the list to find the task with the shortest next CPU burat. 37 Alternatively, list could be ordered according to scheduling criteria (that is, by priority). One other strategy 38 involves having a separate queue for each unique priority. Shown in Figure 5.7. These approaches are briefly 39 discussed in Section 5.3.6. It is also worth highlighting that we are using the terms list and queue sonewhat 40 interchangeably. However, . queue has very specific FIFO functionality, whereas list does not have such strict 41 insertion and deletion requirements. You are likely to find the functionality of a general list to be more suitable 42 when completing this project. 44 Processes should be run in the order they appear in the input. Processes with equal priorities or burst times should be Witable 26 *README.md X book.txt 44 Processes should be run in the order they appear in the input. Processes with equal priorities or burst times should be 45 executed in the order they appear in the input. This applies to ties that may arise during 53F, Priority or Priority 46 with round-robin scheduling (see example output below). 47 484 Implementation Details 49 The file driver.creads in the schedule of tasks, inserts each task into a linked list, and invokes the process se scheduler by calling the schedule() function. The schedule() function executes each task according to the specified 51 scheduling algorithm. Tasks selected for execution on the CPU are determined by the pickNext Task() function and are 52 executed by invoking the 'run() function defined in the CPU.c' file. A "Makefile is used to determine the specific 53 scheduling algorithm that will be invoked by driver. For example, to build the FCFS scheduler, we would enter: 54 55 make fcfs 56 and would execute the scheduler (using the schedule of tasks 'schedule.txt') as follows: 57 ./fcfs schedule.txt 59 Before proceeding, be sure to familiarize yourself with the source code provided as well as the Makefile. 61. Example output 63 Consider the following input: 58 62 64 65 66 67 68 69 70 71 72 23 74 75 76 77 78 79 80 81 82 83 Pe, 9. 35 P1, 10, 25 P2, 7, 40 P3, 6, 20 P4, 10, 40 P5, 4, 35 P6, 10, 20 P7, 3, 35 PS, 3, 30 P9, 4, 38 P10, 4, 35 P11, 8, 20 P12, 4, 20 P13, 5, 15 P14, 7. 10 P15, 1, 25 P16, 8, 25 P17, 6, 30 P18. 2. 48 Writable Insert 120:47:5709 *README.md X book.txt 83 P18, 2, 40 84 P19, 3, 20 85 P20, 9, 10 86 P21, 7, 5 87 P22, 6, 35 88 P23, 3, 40 89 P24, 9, 30 90 91 92 93 Output of the priority scheduling algorithm is given below. 94 95 96 Running task = [P1] [10] [25] for 25 units 97 Running task = [P4] [10] [40] for 48 units 98 Running task = [P6] [10] [20] for 20 units 99 Running task = [PO] [9] [35] for 35 units lee Running task = [P20] [9] [10] for 10 units 101 Running task = [P24] [9] [30] for 30 units 102 Running task = [P11] [8] [20] for 20 units 103 Running task = [P16] [8] [25] for 25 units 104 Running task = [P2] [7] [40] for 48 units 105 Running task = [P14] [7] [10] for 10 units 106 Running task = [P21] [7] [5] for 5 units 107 Running task = [P3] [6] [20] for 20 units 108 Running task = [P17] [6] [30] for 30 units 109 Running task = [P22] [6] [35] for 35 units 110 Running task = [P13] [5] [15] for 15 units 111 Running task = [P5] [4] [35] for 35 units 112 Running task = [P9] [4] [30] for 30 units 113 Running task = (P10) [4] [35] for 35 units 114 Running task = [P12] [4] [20] for 20 units 115 Running task = (P7] [3] [35] for 35 units 116 Running task = [P8] [3] [30] for 38 units 117 Running task = (P19] [3] [20] for 20 units 118 Running task = [P23] [3] [40] for 40 units 119 Running task = (P18] [2] [40] for 40 units 12 Running task = (P15] [1] [25] for 25 units 121 122 Average waiting time = 306.40 LI README.md book. 122 Average waiting time - 386.40 133 Average turnaround time = 333.20 Average response time = 306.40 126 Note 11. For round-robin er priority with round-robin algorithms, the burst time should be the remaining burst time each run of the process. For example, consider the following output for Pe under round-robin: 132 Running task = [PO] [91 [35] for 30 units 131 Running task - (0) (0) (25) for 10 units 132 Running task = (poj (9) (15) for 10 units 133 Running task - (0) (0) (5) for 5 units 234 135 **Note 2Here we don't provide the correct outputs for other algorithms which is intentional as it will deepen your understaning of the way these algorithe work. 136 131 131 140 Deliverables completing this project will require writing the following them, which invoke the appropriate scheduline 143 algorithm 145 schedule of 145 schedule, 38 147 scheduler. 248 schedule_priority. 11 schedule_priority.jr.c 150 1852. And calculating the verwy** ***uenced, haiting time, and response the formach of the above scheduling algorithe 157 1933. You need to suit on the the projecte that includes the starter code (even if it was not modified), 114 Heffle and any source files that are added. Do not salt object (..) ile or compiled executables. IN 156 Evaluation 187 Correct implementation of each algorithm will get 4 marks which make a total of 20 market for project. The 4 men for each for the libre as follow 3383. Correct output (the order and well 2.5 points 1. One incorrect line 0.5 point 2. Two incorrect lines 1 point rate Insanlar I will 11204715 incent 357 Correct implementation of each algorithm will get 4 marks which make a total of 20 marks for project 2. The 4 marks for each algorithm is broken down as follows 1581. Correct output (the order and values): 2.5 points 159 1. One incorrect line: -0.5 point 160 2. Two incorrect lines -1 point 161 . Duplicate lines: -0.5 point 262 4. Three or more lines of mistakes: -2.5 2632. Correct Average waiting time: 0.5 point 1643. Correct Average turnaround time 0.5 point 1654. Correct Average response time 0.5 point I writable mert 1204715708 *README.md book.txt x 1 P1, 4, 5 2 P2, 1, 3 3 P3, 2, 1 4P4, 2, 7 5P5, 3, 4 61 CPU - Notepad File Edit Format View Help "Virtual" CPU that also maintains track of system time. #include #include "task.h" 1/ run this task for the specified time slice void run(Task task, int slice) { printf("Running task - [%] [d] [%d] for %d units ", task->name, task->priority, task-burst, slice); ) cpu.h - Notepad File Edit Format View Help 1/ length of a time quantum #define QUANTUM 10 // run the specified task for the following time slice void run(Task *task, int slice); driver - Notepad File Edit Format View Help * Driver.c Schedule is in the format [name] [priority] (CPU burst] */ #include #include #include #include "task.h" #include "list.h" #include "schedulers.h" #define SIZE 100 int main(int argc, char *argv[]) { FILE *in; char *temp; char task[SIZE]; char *name; int priority; int burst; in = fopen(argv[1],"r"); in = fopen(argv[1],"r"); while (fgets (task, SIZE,in) != NULL) { temp = strdup(task); name = strsep(&temp,", "); priority = atoi(strsep(&temp, ",")); burst = atoi(strsep(&temp.",")); // add the task to the scheduler's list of tasks add(name, priority, burst); free (temp); } fclose(in); // invoke the scheduler schedule(); return 0; } in 1 Col1 100% Unix list - Notepad File Edit Format View Help - Various list operations / #include #include #include #include "list.h" #include "task.h" // add a new task to the list of tasks void insert(struct node **head, Task *newTask) { 77 add the new task to the list struct node *newNode = malloc(sizeof(struct node)); newNode->task = newTask; newNode->next = *head; *head = newNode; 3 // delete the selected task from the list void delete(struct node **head, Task *task) { struct node *temp; struct node *prev; P ite temp "head; // special case beginning of list if (strcmp(task->name, temp->task->name) == 0) { head = ("head) ->next; } else { // interior or last element in the list prev = head; temp = temp->next; else { // interior or last element in the list prev = "head; temp = temp->next; while (strcmp(task->name, temp->task ->name) != 0) { prev = temp; temp = temp->next; } prev->next = temp->next; I raverse the list traverse(struct node "head) { struct node *temp; temp = head; RP 0 it while (temp != NULL) { printf("[%] [%d] [%d] ", temp->task->name, temp->task->priority, temp->task->burst); temp = temp->next; Der Porjed in 1. Col 1 100% Unix (LP) UTF 8 list - Notepad File Edit Format View Help \** * list data structure containing the tasks in the system */ #include "task.h" struct node { Task *task; struct node *next; }; // insert and delete operations. void insert(struct node **head, Task *task); void delete(struct node **head, Task *task); void traverse(struct node *head); README.md book.txt Makefile * 1 makefile for scheduling program 2# 3# make rr - for round-robin scheduling 4# make fcfs - for FCFS scheduling 5# make sjf - for SJF scheduling 6# make priority - for priority scheduling 7# make priority_rr - for priority with round robin scheduling 8 9 CC=CC 10 CFLAGS=-Wall 11 12 clean: 13 rm -rf *.0 14 rm -rf fcfs 15 rm -rf sjf 16 rm -rf mr 17 rm -rf priority 18 rm -rf priority_rr 19 2err: driver.o list.o CPU.O schedule_rr.o 21 $(CC) $(CFLAGS) -o rr driver.o schedule_rr. list.o CPU. 22 23 sif: driver.o list.o CPU.O schedule_sjf.o 24 $(CC) $(CFLAGS) -o sjf driver.o schedule_sjf.o list.o CPU.O 25 26 fcfs: driver.o list.o CPU.O schedule_fcfs.o 27 $(CC) $(CFLAGS) -o fcfs driver.o schedule_fcfs.o list.o CPU.O 29 priority: driver.o list.o CPU.O schedule_priority.o $(CC) $(CFLAGS) -o priority driver.o schedule_priority.o list.o CPU.O 31 32 schedule_fcfs.o: schedule_fcfs.c 33 $(CC) $(CFLAGS) - schedule_fcfs.c 28 30 34 36 37 35 priority_rr: driver.o list.o CPU.O schedule_priority_rr.o $(CC) $(CFLAGS) -o priority_rr driver.o schedule_priority_rr.o list.o CPU.O 38 driver.o: driver.c 39 $(CC) $(CFLAGS) -c driver.c 40 Writable pri-schedule.txt * x 1T1, 1, 50 2 T2, 1, 50 3 T3, 1, 50 4 T4, 1, 50 5 T5, 1, 50 6 T6, 1, 50 rr-schedule.txt X pri-schedule.txt 1|11, 4, 50 2 T2, 4, 50 3 T3, 4, 50 4 T4, 4, 50 5 T5, 4, 50 6 T6, 4, 50 7 schedule.txt x 1111, 4, 20 2 T2, 3, 25 3 T3, 3, 25 4 T4, 5, 15 5 T5, 5, 20 6 T6, 1, 10 717, 3, 30 8 T8, 10, 25 9 schedulers - Notepad File Edit Format View Help #define MIN_PRIORITY 1 #define MAX_PRIORITY 10 // add a task to the list void add(char *name, int priority, int burst); // invoke the scheduler void schedule(); task - Notepad File Edit Format View Help /** Representation of a task in the system. */ #ifndef TASK_H #define TASK_H // representation of a task typedef struct task { char *name; int tid; int priority; int burst; } Task; #endif

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

Step: 3

blur-text-image

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago

Question

LO14.2 Discuss how game theory relates to oligopoly.

Answered: 1 week ago