-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRealTimeOS_Scheduling_README.txt
78 lines (45 loc) · 3.74 KB
/
RealTimeOS_Scheduling_README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
RealTimeOS Scheduling Algorithms README
=========================================
This is the README file for our RealTime OS SCheduling algorithms Implementation code file.
Here we have 2 Structs to store the Processes info and Scheduling Metrics info.
generateRandomProcessesToFile Method Implementation
---------------------------------------------------
Parameter n is passed inside the function.
Creates the new file and writes the data into it, with the Processes information.
A for loop is used and run till n times and Generates the 5 random numbers each time.
readProcessesFromFile Method Implementation
-------------------------------------------
Opens and reads the generated random file, and stores the randonly generated numbers data as Process Name, Burst Time, Priority, Deadline, Period, Share for each process.
checkprio, checkdeadline, checkperiod, checkshare
-------------------------------------------------
Verifies the priorities between any 2 processes according to the piority, deadlines, periods, shares respectively.
calAverageTat, calAverageWaittime, calAverageResponseTime
---------------------------------------------------------
Calculates the Average TurnAround Time, Average Waiting Time, Average Response Time respectively.
runPriorityScheduling, runEDFScheduling, runRMScheduling, runProportionalScheduling
-----------------------------------------------------------------------------------
Schedules the Processes according to the related scheduling algorithms, and calculates the TurnAround Time, Waiting Time, Response Time for each Process.
Main Function
-------------
Main function is passed with 2 arguments, to get the info of number of Processes to execute, from the user.
Calls "generateRandomProcessesToFile" Method and writes the data to the "random_processes.txt" file.
Calls "readProcessesFromFile" Method to read the generated data and store it in struct Process.
Calls "runPriorityScheduling" Method to run the Priority SCheduling Algorithm and prints the results of it i.e., TurnAround Time, Waiting Time, Response Time for each Process.
Same repeats for "runEDFScheduling", "runRMScheduling", "runProportionalScheduling" scheduling Methods and prints the same for each Scheduling algorithm.
Calculates the Scheduling Metrics i.e., Average TurnAround Time, Average Waiting Time, Average Response Time for all the processes for each of the 4 scheduling algorithms, by calling "calAverageTat", "calAverageWaittime", "calAverageResponseTime" respectively and storing them in their respective scheduling metric variables.
Prints each metric value for each scheduling algorithm.
Conclusion
==========
Compares the Average TurnAround Time and Average Waiting Time for all 4 Scheduling algorithms and prints the Best Scheduling Algorithm, which have the lower values of the metrics.
Also, here as we are taking the number of processes value from the user each time we run the code, we can try with different number of processes and analyze the output which gives as the Best Scheduling algorithm, when number of processes varies too.
Execution
=========
After implementing all these methods in the code file, we have to move all this file to the one of the UNT Servers and execute them in PUTTY, by running the following commands.
To compile, run
$ gcc -o RealTimeOS_Scheduling RealTimeOS_Scheduling.c
To test your implementation providing the value of Number of Process to consider, run
$ ./RealTimeOS_Scheduling 5
You can store the output in a file so that you can look at it carefully:
./RealTimeOS_Scheduling 5 > output.txt
You can even store the output each time in the same file and can append it to the all old outputs, run
./RealTimeOS_Scheduling 10 >> output.txt