SlideShare a Scribd company logo
PRIORITY SCHEDULING
AIM
To develop a scheduling algorithm for the processor to process on the basis of priority as
priority scheduling.
ALGORITHM
1. Start the program.
2. Read the number of processes,burst time and CPU time.
3. Initialize large=1 and small=i.
4. Initialize max=min=a[i] and index i is equal to 2 to n.
5. Calculate total time,wait time,average wait time.
6. Calculate the turn around time and the average turn around time.
7. Display the gannt chart.
8. Stop the program.
ROUND ROBIN SCHEDULING
AIM
To write a c program for performing round robin scheduling.
ALGORITHM
1. Start the program.
2. Read the no. of process,burst time and quantum time.
3. Arrange all the processes on the basis of their quantum time such that a process is
made to repeat once again till the entire process is completed.
4. All the processes are arranged in a similar manner.
5. Prepare a gannt chart and display it.
6. Calculate the total execution time,average waiting time and average turn around
time.
7. Stop the program.
BARBER SHOP PROBLEM
AIM:
To write a c program to solve the barber shop problem.
ALGORITHM:
1. get the number of customers who came to barber shop.
2. allocate the customers to the available seats when there are more number of customers
than that of available seats,then make the remaining customers stay in the waiting list.
3. the barbers has to choose to which customers he has to serve.
4. when corresponding customers is choosen the following questions are asked whether he
wants to cut the hair,shaving or trimming.the customers wish is received.
5. the amount for corresponding job is noted.
6. the next customer occupies his seat and questions are coded to the customer when
previous customer leaves the shop.
7. then again the barber chooses the customer and does the his job. Then the customer
leaves the shop after paying barber.
8. the job is completed only when the barber completed only when the barber completes his
work for all the customers
9. atlast when all the customers have gone the profit of the day is calculated.
10. get the number of customers who came to barber shop.
11. allocate the customers to the available seats when there are more number of customers
than that of available seats,then make the remaining customers stay in the waiting list.
12. the barbers has to choose to which customers he has to serve.
13. when corresponding customers is choosen the following questions are asked whether he
wants to cut the hair,shaving or trimming.the customers wish is received.
14. the amount for corresponding job is noted.
15. the next customer occupies his seat and questions are coded to the customer when
previous customer leaves the shop.
DINING PHILOSOPHER’S PROBLEM
AIM
To develop a c program for performing dining philosophers problem.
ALGORITHM
1. Start the program.
2. Get the no of philosophers.
3. Using switch case get the choice for what action to be performed.
4. Then enter which philosopher is going to eat.
5. The status of the philosophers will be displayed.
6. If the philosopher has to wait then the message the chopsticks are engaged will be
displayed.
7. Enter the choice to exit the menu.
8. Stop the program.
BANKER’S ALGORITHM
AIM:
To develop a program to solve the banker’s algorithm to overcome deadlock situation.
ALGORITHM:
1. Start.
2. Input the maximum value and available resources value.
3. For i=1 to n do
4. Check if request I is less than or equal to i. If so proceed step 5.
5. Check if request is available.
6. Compare available as available request and complete allocation as allocation request.
7. Compare need[i] as need[i],request[i].
8. Repeat step 3 until the process get their need as 0.
9. Output the allocated resource values.
10. End.
FIRST IN FIRST OUT PAGE REPLACEMENT ALGORITHM
AIM:
To develop a page replacement algorithm on the basis of first in first out.
ALGORITHM:
1. Initialize the size of the frame size three.
2. Initialize the number of pages which arrives in the queue as 12.
3. Initialize the page numbers.
4. Initially, the contents of the frame are set as -1.
5. As the frame arrives, it is initially placed in the frame.
6. Page fault is calculated when the particular page is not in the frame.
7. The first page which arrives in the frame is the one, which is to be replaced
8. Increment the page fault value.
9. Display the contents of the frame and the page fault value.
10. End the processing.
LEAST RECENTLY USED PAGE REPLACMENT ALGORITHM
AIM:
To develop a page replacement algorithm on the basis of least recently used.
ALGORITHM:
1. Initialize the size of the frame size three.
2. Initialize the number of pages which arrives in the queue as 12.
3. Initialize the page numbers.
4. Initially, the contents of the frame are set as -1.
5. As the page arrives, it is initially placed in the frame.
6. Page fault is calculated when the particular page is not in the frame.
7. The page which is not used frequently, is to be replaced.
8. Increment the page fault value.
9. Display the contents of the frame and the page fault value.
10. End the processing.

More Related Content

PPTX
On email marketing plugins
PDF
C question-answer-bank
PDF
Machine learning pipeline
PDF
Essay Apps For Android. Online assignment writing service.
PPTX
QBA Simulation and Inventory.pptx
PDF
Stop Flying Blind! Quantifying Risk with Monte Carlo Simulation
PDF
Cis 1403 lab1- the process of programming
PDF
Don't drive your Race car on a dirt track!! - Athresh Krishnappa, Scrum Banga...
On email marketing plugins
C question-answer-bank
Machine learning pipeline
Essay Apps For Android. Online assignment writing service.
QBA Simulation and Inventory.pptx
Stop Flying Blind! Quantifying Risk with Monte Carlo Simulation
Cis 1403 lab1- the process of programming
Don't drive your Race car on a dirt track!! - Athresh Krishnappa, Scrum Banga...

Similar to Operating Systems lab Programs Algorithm - Fourth Semester - Engineering (20)

PPTX
Algorithm week2(technovation)
DOCX
A_CH04_EXPV1_H1_Instructions.docxOffice 2013 – myitlabgra.docx
PDF
Using splunk6.2 labs
PPTX
Learning Web Development with Ruby on Rails Launch
PPTX
phases of algorithm
PDF
Assignment2 A
PPTX
How to use Salesforce composite request connector in Mule
PPTX
GR 8 - Summary writing - PowerPoint.pptx
PDF
АНТОН СЕРПУТЬКО « Якісний перфоманс сценарій в Jmeter, це як?» Online QADay ...
PDF
Basics of Algorithm Unit 1 part 1 algorithm
PDF
Automation anywhere Training Materials
PDF
DAA Unit 1.pdf
PDF
Sysanal
PDF
Use cases - As approach to building shared vision
DOCX
osd ncc education assingment l4dc
PPTX
library circulation department manual with web stuff
PDF
Extreme Interview Questions
PDF
PDF
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
DOCX
Work Based Project
Algorithm week2(technovation)
A_CH04_EXPV1_H1_Instructions.docxOffice 2013 – myitlabgra.docx
Using splunk6.2 labs
Learning Web Development with Ruby on Rails Launch
phases of algorithm
Assignment2 A
How to use Salesforce composite request connector in Mule
GR 8 - Summary writing - PowerPoint.pptx
АНТОН СЕРПУТЬКО « Якісний перфоманс сценарій в Jmeter, це як?» Online QADay ...
Basics of Algorithm Unit 1 part 1 algorithm
Automation anywhere Training Materials
DAA Unit 1.pdf
Sysanal
Use cases - As approach to building shared vision
osd ncc education assingment l4dc
library circulation department manual with web stuff
Extreme Interview Questions
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
Work Based Project
Ad

More from Yogesh Santhan (15)

PDF
Career Enhancement Trainings
PDF
Tamil Resume Template
PDF
HUMAR RESOURCES HR RECRUITER RESUME TEMPLATE
PDF
Desire - An Angler
DOC
Operating Systems Third Unit - Fourth Semester - Engineering
DOC
Operating Systems Unit Two - Fourth Semester - Engineering
DOC
Operating Systems Unit One - Fourth Semester - Engineering
DOC
Operating Systems lab Programs - Fourth Semester - Engineering
PDF
A STUDY ON CUSTOMER’S SATISFACTION MARKS CARGO PRIVATE LIMITED - 2
PDF
INTERNSHIP ON EXPORT-IMPORT PROCEDURES AT MARKS CARGO PRIVATE LIMITED, PUDUCH...
PDF
INTERNSHIP ON EXPORT-IMPORT PROCEDURES AT MARKS CARGO PRIVATE LIMITED, PUDUCH...
PDF
Template transfer or change of ownership – no objection letter - mobile number
PDF
Project - UG - BTech IT - Cluster based Approach for Service Discovery using ...
PDF
Research Questionnaire - Employee Referral Program
PDF
Cluster based approach for Service Discovery using Pattern Recognition
Career Enhancement Trainings
Tamil Resume Template
HUMAR RESOURCES HR RECRUITER RESUME TEMPLATE
Desire - An Angler
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit One - Fourth Semester - Engineering
Operating Systems lab Programs - Fourth Semester - Engineering
A STUDY ON CUSTOMER’S SATISFACTION MARKS CARGO PRIVATE LIMITED - 2
INTERNSHIP ON EXPORT-IMPORT PROCEDURES AT MARKS CARGO PRIVATE LIMITED, PUDUCH...
INTERNSHIP ON EXPORT-IMPORT PROCEDURES AT MARKS CARGO PRIVATE LIMITED, PUDUCH...
Template transfer or change of ownership – no objection letter - mobile number
Project - UG - BTech IT - Cluster based Approach for Service Discovery using ...
Research Questionnaire - Employee Referral Program
Cluster based approach for Service Discovery using Pattern Recognition
Ad

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
RMMM.pdf make it easy to upload and study
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
Institutional Correction lecture only . . .
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
master seminar digital applications in india
PDF
Computing-Curriculum for Schools in Ghana
PDF
Classroom Observation Tools for Teachers
PPTX
Cell Structure & Organelles in detailed.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial disease of the cardiovascular and lymphatic systems
Anesthesia in Laparoscopic Surgery in India
RMMM.pdf make it easy to upload and study
Final Presentation General Medicine 03-08-2024.pptx
Cell Types and Its function , kingdom of life
Institutional Correction lecture only . . .
Microbial diseases, their pathogenesis and prophylaxis
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
master seminar digital applications in india
Computing-Curriculum for Schools in Ghana
Classroom Observation Tools for Teachers
Cell Structure & Organelles in detailed.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
202450812 BayCHI UCSC-SV 20250812 v17.pptx

Operating Systems lab Programs Algorithm - Fourth Semester - Engineering

  • 1. PRIORITY SCHEDULING AIM To develop a scheduling algorithm for the processor to process on the basis of priority as priority scheduling. ALGORITHM 1. Start the program. 2. Read the number of processes,burst time and CPU time. 3. Initialize large=1 and small=i. 4. Initialize max=min=a[i] and index i is equal to 2 to n. 5. Calculate total time,wait time,average wait time. 6. Calculate the turn around time and the average turn around time. 7. Display the gannt chart. 8. Stop the program. ROUND ROBIN SCHEDULING AIM To write a c program for performing round robin scheduling. ALGORITHM 1. Start the program. 2. Read the no. of process,burst time and quantum time. 3. Arrange all the processes on the basis of their quantum time such that a process is made to repeat once again till the entire process is completed. 4. All the processes are arranged in a similar manner. 5. Prepare a gannt chart and display it. 6. Calculate the total execution time,average waiting time and average turn around time. 7. Stop the program.
  • 2. BARBER SHOP PROBLEM AIM: To write a c program to solve the barber shop problem. ALGORITHM: 1. get the number of customers who came to barber shop. 2. allocate the customers to the available seats when there are more number of customers than that of available seats,then make the remaining customers stay in the waiting list. 3. the barbers has to choose to which customers he has to serve. 4. when corresponding customers is choosen the following questions are asked whether he wants to cut the hair,shaving or trimming.the customers wish is received. 5. the amount for corresponding job is noted. 6. the next customer occupies his seat and questions are coded to the customer when previous customer leaves the shop. 7. then again the barber chooses the customer and does the his job. Then the customer leaves the shop after paying barber. 8. the job is completed only when the barber completed only when the barber completes his work for all the customers 9. atlast when all the customers have gone the profit of the day is calculated. 10. get the number of customers who came to barber shop. 11. allocate the customers to the available seats when there are more number of customers than that of available seats,then make the remaining customers stay in the waiting list. 12. the barbers has to choose to which customers he has to serve. 13. when corresponding customers is choosen the following questions are asked whether he wants to cut the hair,shaving or trimming.the customers wish is received. 14. the amount for corresponding job is noted. 15. the next customer occupies his seat and questions are coded to the customer when previous customer leaves the shop.
  • 3. DINING PHILOSOPHER’S PROBLEM AIM To develop a c program for performing dining philosophers problem. ALGORITHM 1. Start the program. 2. Get the no of philosophers. 3. Using switch case get the choice for what action to be performed. 4. Then enter which philosopher is going to eat. 5. The status of the philosophers will be displayed. 6. If the philosopher has to wait then the message the chopsticks are engaged will be displayed. 7. Enter the choice to exit the menu. 8. Stop the program. BANKER’S ALGORITHM AIM: To develop a program to solve the banker’s algorithm to overcome deadlock situation. ALGORITHM: 1. Start. 2. Input the maximum value and available resources value. 3. For i=1 to n do 4. Check if request I is less than or equal to i. If so proceed step 5. 5. Check if request is available. 6. Compare available as available request and complete allocation as allocation request. 7. Compare need[i] as need[i],request[i]. 8. Repeat step 3 until the process get their need as 0. 9. Output the allocated resource values. 10. End. FIRST IN FIRST OUT PAGE REPLACEMENT ALGORITHM AIM: To develop a page replacement algorithm on the basis of first in first out. ALGORITHM: 1. Initialize the size of the frame size three.
  • 4. 2. Initialize the number of pages which arrives in the queue as 12. 3. Initialize the page numbers. 4. Initially, the contents of the frame are set as -1. 5. As the frame arrives, it is initially placed in the frame. 6. Page fault is calculated when the particular page is not in the frame. 7. The first page which arrives in the frame is the one, which is to be replaced 8. Increment the page fault value. 9. Display the contents of the frame and the page fault value. 10. End the processing. LEAST RECENTLY USED PAGE REPLACMENT ALGORITHM AIM: To develop a page replacement algorithm on the basis of least recently used. ALGORITHM: 1. Initialize the size of the frame size three. 2. Initialize the number of pages which arrives in the queue as 12. 3. Initialize the page numbers. 4. Initially, the contents of the frame are set as -1. 5. As the page arrives, it is initially placed in the frame. 6. Page fault is calculated when the particular page is not in the frame. 7. The page which is not used frequently, is to be replaced. 8. Increment the page fault value. 9. Display the contents of the frame and the page fault value. 10. End the processing.