CS2257

Exp# 4c

Operating System Lab

Priority Scheduling

Aim To schedule snapshot of processes queued according to Priority scheduling.

Algorithm 1. 2. 3. 4.

Define an array of structure process with members pid, btime, pri, wtime & ttime. Get length of the ready queue, i.e., number of process (say n) Obtain btime and pri for each process. Sort the processes according to their pri in ascending order. a. If two process have same pri, then FCFS is used to resolve the tie. 5. The wtime for first process is 0. 6. Compute wtime and ttime for each process as: a. wtimei+1 = wtimei + btimei b. ttimei = wtimei + btimei 7. Compute average waiting time awat and average turn around time atur 8. Display the btime, pri, ttime and wtime for each process. 9. Display GANTT chart for the above scheduling 10. Display awat and atur 11. Stop

Result Thus waiting time & turnaround time for processes based on Priority scheduling was computed and the average waiting time was determined.

http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

Program /* Priority Scheduling

- pri.c */

#include struct process { int pid; int btime; int pri; int wtime; int ttime; } p[10], temp; main() { int i,j,k,n,ttur,twat; float awat,atur; printf("Enter no. of process : "); scanf("%d", &n); for(i=0; i p[j].pri) || (p[i].pri == p[j].pri && p[i].pid > p[j].pid) ) { temp = p[i]; p[i] = p[j]; p[j] = temp; } } } p[0].wtime = 0; for(i=0; i
http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

ttur = twat = 0; for(i=0; i
http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

Output $ gcc pri.c $ ./a.out Enter no. of process : 5 Burst time for process P1 Priority for process P1 : Burst time for process P2 Priority for process P2 : Burst time for process P3 Priority for process P3 : Burst time for process P4 Priority for process P4 : Burst time for process P5 Priority for process P5 :

(in 3 (in 1 (in 3 (in 4 (in 2

ms) : 10 ms) : 7 ms) : 6 ms) : 13 ms) : 5

Priority Scheduling -------------------------------------Process B-Time Priority T-Time W-Time -------------------------------------P2 7 1 7 0 P5 5 2 12 7 P1 10 3 22 12 P3 6 3 28 22 P4 13 4 41 28 -------------------------------------GANTT Chart ---------------------------------------------------| P2 | P5 | P1 | P3 | P4 | ---------------------------------------------------0 7 12 22 28 41 Average waiting time : 13.80ms Average turn around time : 22.00ms

http://cseannauniv.blogspot.com

Vijai Anand

Priority Scheduling

To schedule snapshot of processes queued according to Priority scheduling. Algorithm. 1. Define an array of structure process with members pid, btime, pri, wtime & ttime. 2. Get length of the ready queue, i.e., number of process (say n). 3. Obtain btime and pri for each process. 4. Sort the processes according to their pri in ...

11KB Sizes 0 Downloads 251 Views

Recommend Documents

RT-Seed: Real-Time Middleware for Semi-Fixed-Priority Scheduling
middleware, which implements a semi-fixed-priority scheduling algorithm, called .... (e.g., EUR/USD) from a stock company, the parallel optional parts conduct ..... many-core platform software stack 3.3.4 (released on March. 13, 2015) [16] on ...

MMUHS Priority Indicators.pdf
27.3%. Richmond. 24.7%. Underhill. 14.6%. Underhill ID. 13.0%. Tuition. 3.3%. School Choice. 1%. Whoops! There was a problem loading this page. Retrying.

Priority List Structures.pdf
El Roblar Hotel. El Roblar Hotel. The hotel was built under the direction of Mr. Edward Libbey. It was part of his downtown The hotel was built under the direction of Mr. Edward Libbey. It was part of his downtown. improvement project, although it wa

Priority Unit--grade 3.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Priority ...

PRIORITY-DRIVEN BEHAVIORS UNDER THE ...
Jan 20, 2017 - Keywords: Two-sided many-to-one matching; school choice; Boston algorithm; ma- .... with priority at that school over one of the assigned students. ...... Mennle, T., and S. Seuken (2015): “Trade-offs in School Choice: ...

Merrimack Valley Planning Commission – Priority Growth ...
Merrimack Valley Planning Commission – Priority Growth Presentation.pdf. Merrimack Valley Planning Commission – Priority Growth Presentation.pdf. Open.

Priority Date Tracker (2011.06).pdf
Connect more apps... Try one of the apps below to open or edit this item. Priority Date Tracker (2011.06).pdf. Priority Date Tracker (2011.06).pdf. Open. Extract.

Insertion Scheduling: An Alternative to List Scheduling ...
constraints between the tasks, build a schedule which satisfies the precedence and the ... reservation vector, for the conditional stores of the DEC Alpha 21064.

Scheduling Fairness of Real-Time Scheduling ...
MExp, outage capacity, quality of service (QoS), scheduling fairness, ... Wireless industry has been making its way to the field of real-time multimedia applications. ... data applications over both wire-line and wireless channels, multiplexing ...

APPLICATION DEADLINES: Priority consideration- Monday, April 13 ...
Jun 4, 2015 - The “Youth Service Academy” Program is a partnership between the Los Angeles Department of Water and Power and the Los Angeles Unified School District. LAUSD students will participate in an internship with LADWP personnel at the DWP

5LIST OF PRIORITY DIRECTION AND CORE TECHNOLOGY.pdf ...
Page 1 of 1. Government of the year 2015. Attachment to resolution 368. LIST OF PRIORITY DIRECTION AND CORE TECHNOLOGY. TO DEVELOP SCHIENCE AND TECHNOLOGY (2015-2021). I. Priority direction: 1. Human development and the environment. 2. Intensificatio

Hylomorphism and the Priority Principle
In his 2010 article, “Aristotelian Endurantism,” and, more recently, in his 2014 book, ... on a hylomorphic account of human persons, no human person is ever the ...

FCFS Scheduling
To schedule snapshot of processes queued according to FCFS (First Come First Serve) scheduling. Algorithm. 1. Define an array of structure process with members pid, btime, wtime & ttime. 2. Get length of the ready queue, i.e., number of process (say

Fast Modulo Scheduling Under the Simplex Scheduling ...
framework, where all the computations are performed symbolically with T the .... Indeed the renewable resources in an instruction scheduling problem are the ...

planning and scheduling
ment of PDDL (Planning Domain De nition Language), a language for ... Satisfaction (CSP) or Constraint Programming. The dis- ..... cision Procedure for AR.

The Learning Behind Gmail Priority Inbox - Research at Google
Social features are based on the degree of interaction .... models. The challenge is to feed data over the network at a rate that keeps the cores busy. Bigtable.

Mixed Priority Elastic Resource Allocation in Cloud Computing ... - IJRIT
Cloud computing is a distributed computing over a network, and means the ... In this they use the stack to store user request and pop the stack when they need.

Priority consideration- Monday, April 13, 2015 by 5 ...
3. Right to Work documents – social security card, students MUST POSSESS A VALID. CALIFORNIA ID/DRIVER'S LICENSE OR VALID US PASSPORT/ OR VALID ALIEN. REGISTRATION CARD AND SOCIAL SECURITY CARD and birth certificate. 4. Afternoons must be open –

Stability and Efficiency in the General Priority-based ...
Six students are consisted of two white, two black, ...... s3 s4 race black black white white gender male female male female. When a school respects both race ...

Transparency has long been Auctionata's top priority - cloudfront.net
Mar 31, 2016 - KPMG Governance and Compliance report was commissioned by ... monitoring adherence to the legal and regulatory requirements and has ...