Programming in C - CPU Scheduling - Round Robin
Programming in C - CPU Scheduling - Round Robin
Programming in c
ABOUT ME
that produces large jobs would be favoured over other processes. This problem may be solved by time-sharing, i.e. by giving
each job a time slot or quantum (its allowance of CPU time), and interrupt the job if it is not completed by then. The job is
resumed next time a time slot is assigned to that process.
Example: The time slot could be 100 milliseconds. If job1 takes a total time of 250ms to complete, the round-robin
scheduler will suspend the job after 100ms and give other jobs their time on the CPU. Once the other jobs have had their
equal share (100ms each), job1 will get another allocation of CPU time and the cycle will repeat. This process continues
until the job finishes and needs no more time on the CPU.
PROGRAM:
#include<stdio.h>
#include<conio.h>
main()
{
int st[10],bt[10],wt[10],tat[10],n,tq;
POPULAR POSTS
int i,count=0,swt=0,stat=0,temp,sq=0;
float awt=0.0,atat=0.0;
clrscr();
Fractional Knapsack
Problem
OBJECTIVE:
Implementation of
fractional knapsack
problem. THEORY: The
Fractional Knapsack
Problem usually sounds
like this: Thief has ju...
st[i]=bt[i];
temp=tq;
http://iitkamalesh.blogspot.com/2011/02/cpu-scheduling-round-robin.html
1/3
2/15/2014
Banker's Algorithm
OBJECTIVE:
Implementation of
Banker's Algorithm.
THEORY: The Banker's
algorithm is run by the
operating system
whenever a proces...
Process Synchronization
idealstudent.blogger.com
Synchronizing POSTFIX
thread using MUREX
variable
OBJECTIVE: Write a
Program for synchronizing
POSTFIX thread using
Murex variable. THEORY:
Technically, a thread is
defined as an
independen...
st[i]=st[i]-tq;
else
if(st[i]>=0)
{
temp=st[i];
st[i]=0;
}
sq=sq+temp;
tat[i]=sq;
}
if(n==count)
break;
}
for(i=0;i<n;i++)
{
wt[i]=tat[i]-bt[i];
swt=swt+wt[i];
stat=stat+tat[i];
}
Program to restrict
keyboard using c++
#include #include
#include using
namespace std; int main()
{ char input[250] = {'\0'};
char *i = input; char c; ...
awt=(float)swt/n;
Dinning Philosopher
Problem
OBJECTIVE :
Implementation of process
synchronization(DINNING
PHILOSOPHER
PROBLEM) THEORY:
The goal of problem is to
create a program that ...
",i+1,bt[i],wt[i],tat[i]);
Heap Sort
OBJECTIVE:
Implementation of heap
sort. THEORY: Heapsort
primarily competes with
quicksort, another very
efficient general purpose
nearly-...
N Queen Problem
OBJECTIVE: c
Implementation of NQueen problem.
THEORY: The concept of
N queens problem is that
we need to place N
queens in N x N matrix ...
atat=(float)stat/n;
printf("Process_no Burst time Wait time Turn around time
");
for(i=0;i<n;i++)
printf("%d %d %d %d
printf("Avg wait time is %f
Avg turn around time is %f",awt,atat);
getch();
}
No comments:
Post a Comment
Comment as:
Publish
Google Account
Preview
TOTAL PAGEVIEWS
12,560
BLOG ARCHIVE
2011 (15)
March (1)
February (14)
Program to restrict
keyboard using
c++
How can I make my
blog load faster? -
http://iitkamalesh.blogspot.com/2011/02/cpu-scheduling-round-robin.html
2/3
2/15/2014
Newer Post
Home
0/1 Knapsack
Problem
Older Post
kruskal Algorithms
Fractional Knapsack
Problem
N Queen Problem
Heap Sort
Self
FOLLOWERS
Join this site
w ith Google Friend Connect
Members (3)
http://iitkamalesh.blogspot.com/2011/02/cpu-scheduling-round-robin.html
3/3