Giter Site home page Giter Site logo

earliest_deadline_first's Introduction

Wrote a very simple EDF scheduler as a part of RTOS curriculum.It is recommended to compile the program with GCC.The old Turbo C too will work :-P
Hope you like it. :-)
Use the following command to compile in GCC.

gcc main.c func_def.c  -o EDF

Sample:
________________________________________________________________
Tasks 	  | Arrival	| Execution     | Deadline     | Period    
----------------------------------------------------------------
T1	  |   1		|	  3 	|	6      |   9 
T2	  |   3		|	  2 	|	5      |   12 
T3	  |   4		|	  4 	|	10     |   16 
----------------------------------------------------------------


How the program looks like

winston@winston-VirtualBox:~/EDF_Scheduler$ ./EDF
Enter number of tasks
3
Enter Task 1 parameters
Arrival time: 1
Execution time: 3
Deadline time: 6
Period: 8
Enter Task 2 parameters
Arrival time: 3
Execution time: 2
Deadline time: 5
Period: 12
Enter Task 3 parameters
Arrival time: 4
Execution time: 4
Deadline time: 10
Period: 16
CPU Utilization 0.791667
Tasks can be scheduled
0  Idle
1  Task 1
2  Task 1
3  Task 1
4  Task 2
5  Task 2
6  Task 3
7  Task 3
8  Task 3
9  Task 3
10  Task 1
11  Task 1
12  Task 1
13  Idle
14  Idle
15  Task 2
16  Task 2
17  Task 1
18  Task 1
19  Task 1
20  Task 3
21  Task 3
22  Task 3
23  Task 3
24  Idle
25  Task 1
26  Task 1
27  Task 1
28  Task 2
29  Task 2
30  Idle
31  Idle
32  Idle
33  Task 1
34  Task 1
35  Task 1
36  Task 3
37  Task 3
38  Task 3
39  Task 2
40  Task 2
41  Task 3
42  Task 1
43  Task 1
44  Task 1
45  Idle
46  Idle
47  Idle
48  Idle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.