Submit Search
Upload
Rate monotonic scheduling- Operating System
•
0 likes
•
670 views
Bhavik Vashi
Follow
Rate monotonic scheduling
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 5
Download now
Download to read offline
Recommended
C++ Inheritance
C++ Inheritance
Jussi Pohjolainen
Doubly Linked List
Doubly Linked List
V.V.Vanniaperumal College for Women
Doubly Linked List
Doubly Linked List
Ninad Mankar
Computer architecture pipelining
Computer architecture pipelining
Mazin Alwaaly
Arduino- Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
System calls
System calls
AfshanKhan51
Introduction to class in java
Introduction to class in java
kamal kotecha
Arduino presentation by_warishusain
Arduino presentation by_warishusain
student
Recommended
C++ Inheritance
C++ Inheritance
Jussi Pohjolainen
Doubly Linked List
Doubly Linked List
V.V.Vanniaperumal College for Women
Doubly Linked List
Doubly Linked List
Ninad Mankar
Computer architecture pipelining
Computer architecture pipelining
Mazin Alwaaly
Arduino- Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
System calls
System calls
AfshanKhan51
Introduction to class in java
Introduction to class in java
kamal kotecha
Arduino presentation by_warishusain
Arduino presentation by_warishusain
student
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
Sanjit Shaw
Priority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
Data structure tree - intermediate
Data structure tree - intermediate
MD. MARUFUZZAMAN .
Introduction to Node MCU
Introduction to Node MCU
Amarjeetsingh Thakur
Heaps
Heaps
pratmash
File and directories in python
File and directories in python
Lifna C.S
Fuzzy neural networks
Fuzzy neural networks
Brainware University
Heapsort using Heap
Heapsort using Heap
Mohamed Fawzy
Programming Fundamentals Functions in C and types
Programming Fundamentals Functions in C and types
imtiazalijoono
Mobile computing : Indirect TCP
Mobile computing : Indirect TCP
Sushant Kushwaha
Back propagation
Back propagation
Nagarajan
Inline Functions and Default arguments
Inline Functions and Default arguments
Nikhil Pandit
User defined functions
User defined functions
Rokonuzzaman Rony
Constructors and Destructors
Constructors and Destructors
Dr Sukhpal Singh Gill
Python-Inheritance.pptx
Python-Inheritance.pptx
Karudaiyar Ganapathy
Breadth first search (bfs)
Breadth first search (bfs)
Bishal Bhandari
Expression evaluation
Expression evaluation
JeeSa Sultana
c++ lab manual
c++ lab manual
Shrunkhala Wankhede
Inheritance in c++
Inheritance in c++
Vineeta Garg
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Prakash Zodge
Aws ec2
Aws ec2
Bhavik Vashi
MACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
More Related Content
What's hot
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
Sanjit Shaw
Priority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
Data structure tree - intermediate
Data structure tree - intermediate
MD. MARUFUZZAMAN .
Introduction to Node MCU
Introduction to Node MCU
Amarjeetsingh Thakur
Heaps
Heaps
pratmash
File and directories in python
File and directories in python
Lifna C.S
Fuzzy neural networks
Fuzzy neural networks
Brainware University
Heapsort using Heap
Heapsort using Heap
Mohamed Fawzy
Programming Fundamentals Functions in C and types
Programming Fundamentals Functions in C and types
imtiazalijoono
Mobile computing : Indirect TCP
Mobile computing : Indirect TCP
Sushant Kushwaha
Back propagation
Back propagation
Nagarajan
Inline Functions and Default arguments
Inline Functions and Default arguments
Nikhil Pandit
User defined functions
User defined functions
Rokonuzzaman Rony
Constructors and Destructors
Constructors and Destructors
Dr Sukhpal Singh Gill
Python-Inheritance.pptx
Python-Inheritance.pptx
Karudaiyar Ganapathy
Breadth first search (bfs)
Breadth first search (bfs)
Bishal Bhandari
Expression evaluation
Expression evaluation
JeeSa Sultana
c++ lab manual
c++ lab manual
Shrunkhala Wankhede
Inheritance in c++
Inheritance in c++
Vineeta Garg
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Prakash Zodge
What's hot
(20)
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
Priority Queue in Data Structure
Priority Queue in Data Structure
Data structure tree - intermediate
Data structure tree - intermediate
Introduction to Node MCU
Introduction to Node MCU
Heaps
Heaps
File and directories in python
File and directories in python
Fuzzy neural networks
Fuzzy neural networks
Heapsort using Heap
Heapsort using Heap
Programming Fundamentals Functions in C and types
Programming Fundamentals Functions in C and types
Mobile computing : Indirect TCP
Mobile computing : Indirect TCP
Back propagation
Back propagation
Inline Functions and Default arguments
Inline Functions and Default arguments
User defined functions
User defined functions
Constructors and Destructors
Constructors and Destructors
Python-Inheritance.pptx
Python-Inheritance.pptx
Breadth first search (bfs)
Breadth first search (bfs)
Expression evaluation
Expression evaluation
c++ lab manual
c++ lab manual
Inheritance in c++
Inheritance in c++
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
More from Bhavik Vashi
Aws ec2
Aws ec2
Bhavik Vashi
MACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
Cloud computing
Cloud computing
Bhavik Vashi
Linear Sorting
Linear Sorting
Bhavik Vashi
Colormodels
Colormodels
Bhavik Vashi
Kruskal Algorithm
Kruskal Algorithm
Bhavik Vashi
Runge Kutta Method
Runge Kutta Method
Bhavik Vashi
Data Structure Radix Sort
Data Structure Radix Sort
Bhavik Vashi
File management in OS
File management in OS
Bhavik Vashi
Types of Constructor in C++
Types of Constructor in C++
Bhavik Vashi
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
Bhavik Vashi
Ethernet and switches
Ethernet and switches
Bhavik Vashi
Fiscal Policy & Monetary Policy
Fiscal Policy & Monetary Policy
Bhavik Vashi
Diwali Light
Diwali Light
Bhavik Vashi
Heat transfer
Heat transfer
Bhavik Vashi
Projection of lines
Projection of lines
Bhavik Vashi
Most Successful People & Personality
Most Successful People & Personality
Bhavik Vashi
Global Need of the World
Global Need of the World
Bhavik Vashi
Functions of stdio conio
Functions of stdio conio
Bhavik Vashi
Impact of social media
Impact of social media
Bhavik Vashi
More from Bhavik Vashi
(20)
Aws ec2
Aws ec2
MACRO PROCESSOR
MACRO PROCESSOR
Cloud computing
Cloud computing
Linear Sorting
Linear Sorting
Colormodels
Colormodels
Kruskal Algorithm
Kruskal Algorithm
Runge Kutta Method
Runge Kutta Method
Data Structure Radix Sort
Data Structure Radix Sort
File management in OS
File management in OS
Types of Constructor in C++
Types of Constructor in C++
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
Ethernet and switches
Ethernet and switches
Fiscal Policy & Monetary Policy
Fiscal Policy & Monetary Policy
Diwali Light
Diwali Light
Heat transfer
Heat transfer
Projection of lines
Projection of lines
Most Successful People & Personality
Most Successful People & Personality
Global Need of the World
Global Need of the World
Functions of stdio conio
Functions of stdio conio
Impact of social media
Impact of social media
Rate monotonic scheduling- Operating System
1.
Rate Monotonic Scheduling #include<iostream> #include<fstream> #include<algorithm> using
namespace std; #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> int pnum=0,lcmno,p[2][100],cap[2][100]; int lcm(int a[],int n); int gcd(int a, int b); class pro { public: void get() { fstream file("Input File.txt",ios::out | ios::in); int t1; string temp; while (!file.eof()) { file>>temp>>t1>>temp>>p[0][pnum]>>temp>>p[1][pnum]; pnum++; } pnum--; file.close(); int temp1[100]; for(int i=0;i<pnum;i++) { temp1[i]=p[1][i]; } lcmno=lcm(temp1,pnum); } void display(void ) { cout<<"Process:t1t2t3t4t5n"; for(int i=0;i<2;i++) { for(int j=0;j<pnum;j++) { if(j==0 && i==0) Page 1
2.
Rate Monotonic Scheduling { cout<<"CPU
TIME:t"<<p[i][j]<<"t"; } else if(j==0 && i==1) { cout<<"Period:tt"<<p[i][j]<<"t"; } else { cout<<p[i][j]<<"t"; } } cout<<"n"; } cout<<"LCM:"<<lcmno<<endl; } int check() { int i,n=pnum; float in=((float)1/(float)n); float u=((n)*(pow(2.0,((float)1/(float)n))-1)); float ut=0; for(i=0;i<pnum;i++) { ut=ut+((float)p[0][i]/(float)p[1][i]); } cout<<"Utilization Bond:"<<u; cout<<"nTotal Utilization Time:"<<ut; if(u>ut) return 1; else return 0; } }; int priority(); void sch(); int lcm(int a[],int n) { int ans = a[0]; for (int i = 1; i < n; i++) { ans = (((a[i] * ans)) /(gcd(a[i], ans))); } Page 2
3.
Rate Monotonic Scheduling return
ans; } int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int priority() { int p=-1,lessp=lcmno; { for(int i=0;i<pnum;i++) { if(cap[0][i]!=0) { if(lessp>cap[1][i]) { p=i; lessp=cap[1][i]; } } } } return p; } void sch() { fstream file("Output File.txt",ios::out ); int t,pr,i; for(i=0;i<pnum;i++) { cap[0][i]=p[0][i]; cap[1][i]=p[1][i]; } for(t=0;t<lcmno;t++) { for(i=0;i<pnum;i++) { if(cap[0][i]>cap[1][i]) { cout<<"System is not scheduablen"; return; Page 3
4.
Rate Monotonic Scheduling } } pr=priority(); if(pr!=-1) { file<<t<<"-"<<t+1<<"|Process:"<<pr+1<<endl; } else { file<<t<<"-"<<t+1<<endl; } cap[0][pr]--; for(i=0;i<pnum;i++) { cap[1][i]--; if(cap[1][i]==0) { cap[0][i]=p[0][i]; cap[1][i]=p[1][i]; } } } file.close(); } int
main() { pro ob1; ob1.get(); ob1.display(); int c=ob1.check(); if(c==0) { cout<<"nScheduling is not possiblen"; } else { cout<<"nScheduling is possiblen"; sch(); } return 0; } Page 4
5.
Rate Monotonic Scheduling Page
5
Download now