SlideShare a Scribd company logo
1 of 29
Download to read offline
COMPUTER OPERATING SYSTEM
(COS)
GROUP 8 PRESENTATION
GROUP MEMBERS
• CLEMENT CHULU
• FLAVIOUR CHIPAMBA
• SAMUEL SIANAMATE
• BLESSINGTON MUSONDA
• HAPPY NG’AMBI
PROCESS SCHEDULING
• Proceess scheduling is an Operating System(O.S) task that schedules processes of different states like ready, waiting and
running
• It allows O.S to allocate a time interval of CPU execution for each process
• It is very important because it keeps the CPU busy all the time
PROCESS SCHEDULING QUEUES
• A queue is simply a collection of processes n storage that are waiting to be brought into memory to run a program
• Therefore, PSQ help the user to maintain a distinct queue for each and every process States and Printed CircuitBoards (PCBs)
• This is done in such a waythat all processes of the same execution state are placed in the same queue
1. Job queue: keeps or stores all the processesin the system
2. Ready queue: keeps a set of all processesresiding in main memory which are ready and waitingto execute
3. Device queue: constitutes of processeswhich are blocked due to unavailability of I/O device
OVERVIEW OF PROCESS SCHEDULING
TWO STATE PROCESS MODEL
1. Running state: In the O.S, whenever a new process is built, it is entered into the system which should be running
2. Not Running state: Processes that are not running are kept in a queue, which is waiting for their turn to execute
SCHEDULING OBJECTIVES
• Maximize the number of interactive users within acceptable response times
• Achieve a balance between response and utilization
• Avoid definite postponement and enforce priorities
• It also should give reference to the processes holding the key resources
TYPES OF PROCESS SCHEDULRS
• A scheduler is a type of system software that allows the user to handle process scheduling
• There are mainly three types of schedulers:
1. LONG TERM SCHEDULER- This is also known as the job scheduler. It regulates the program and select process from the queue and leads them into memory for execution
• It’s main is to offer a balanced mix of jobs like processor, I/O jobs, that allow managing multiprogramming
2. MEDIUM TERM SCHEDULER- It’s an important part of swapping, for it enables the user to handle the swapped out-processes
• In this scheduler, a running process can become suspended. Which makes I/O request.
• A suspended process can’t make progress toward completion. In order to remove the process from memory and make space for other processes. The suspended process should be moved to secondary storage
3. SHORT TERM SCHEDULER-This is also known as CPU scheduler
• Its main goal is to boost the system performance according to set criteria
• This helps the user to select from a group of processes that are ready to execute and allocates CPUto one of them
DIFFERENCE BETWEEN SCHEDULRS
LONG TERM SHORT TERM MIDDLE TERM
• It’s also known as job scheduler • Also known as a CPU scheduler • Is also called swapping scheduler
• It’s either absent or minimal in a time sharing system • It is significant in the time sharing order • It’s an element of Time-sharing systems
• Speed is less compared to the short term scheduler • Speed is the fastest compared to the long term and
medium term scheduler
• It offers medium speed
• Allows user to select process from the loads and pool
back into the memory
• It only selects processes that is in a ready state of the
execution
• It helps users to send process back to memory
• Offers full control • Offers less control • Reduce the level of multiprogramming
PSEUDO CODE CONCEPTS
• Pseudocode is a simple wayof writing programming code in English
• It is not actual programming language
• It is offen used in all various fields of programming, wether it be app development, data science, or web development
• Pseudocode is a technique used to describe the distinctsteps of an algorithm in a manner that is easy to understand for anyone
with basic programming knowledge
• It uses short terms or simple English language syntaxesto writecode for programs before it is actually converted into a specific
programming language
MAIN CONSTRUCTS OF PSEUDO CODE
• The core of pseudocode is the ability to represent 6 programming constructs.( Always written in upper case): SEQUENCE, CASE, WHILE, REPEAT-UNTIL, FOR
and IF-THEN-ELSE
• These constructs also called keywords are used to describe the control flow of the algorithm
• SEQUENCE: Represents linear tasks sequentially performed one after the other
• WHILE: A loop with a condition at it’s beginning
• REPEAT-UNTIL: A loop with a condition at the bottom
• FOR: Another way of looping
• IF-THEN-ELSE: A condition statement changing the flow of the algorithm
• CASE: The generalizationform of IF-THEN-ELSE
RULES FOR PSEUDOCODE
• Example;
• TASK LIST:
Read name, hourlyrate, hoursworked, deduction rate,
Perform calculations
grossPay=hourly Rate*hourly Worked
deduuction=gross pay*deduction Rate
netPay=grossPay – deduction
Write name, grossdeduction, netpay
• PSEUDOCODE
READname, hourlyRate,hours worked,deductionRate
grossPay=hourlyRate*hourlyWorked
deduction=grossPay*deductionRate
netPay= grossPay– deduction
WRITE name, grossPay, deduction,netPay
RULES FOR PSEUDOCODE
1. WRITE ONLY 1 STATEMENT PER LINE
• Each statement should express just one action for the computer
2. CAPITALIZE INITIAL KEY WORDS
• In the above example, READ and WRITE are in caps
• There are just a few keywords used
• READ, WRITE, IF, ELSE,END IF, WHILE, END WHILE, REPEAT-UNTIL
3. INDENT TO SHOW HIERARCHY
• A particular indentation pattern in each of the design structure is used:
• SEQUENCE – Keeps the statements that are stacked in sequence all starting in the same column
• SELECTION – Indent the statements that fall inside the selection structure, but not the key words that form the selection
• LOOPING – Indent the statements that fall inside the loop,but not keywords that form the loop
- In the above example, employeeswhose grossPayisless than 100 do nothave anydeduction.E.g:
RULES FOR PSEUDOCODE
4 . END MULTILINE STRUCTURES
• See how the IF/ELSE/END IF is constructedabove
• The END IF or ( END Whatever) always is in line with the IF or (whatever starts thestructure).
5. KEEP STATEMENTS LANGUAGE INDEPENDENT
• Resist the urge to write in whatever languageyou are most comfortablewith
• It saves time in a long run!
• ADVANTAGES OF PSEUDO CODE
• It can quickly and easily converted into an actual programming language as it is similar to a programming language
• It is fairly easy to understand, even for non programmers
• It doesn’t matter if there are errors in the syntax. It is usually still obvious what is intended
• Changes to the design can be incorporated quite easily
DISADVANTAGES OF PSEUDO CODE
• It can be hard to see how a program flows.e.g; where does following one path as opposed to another take the program?
• It can be time consuming to produce
EXAMPLE OF WHAT IT LOOKS LIKE
SCHEDULING ALGORITHM (ROUND-ROBIN)
• The name of this algorithm comes from the round-robin principal, where each person gets an equal share of something
in turns
• In round-robin scheduling, each ready task runs turn by turn only in a cyclic queue for a limited time slice
• This algorithm also offers starvation free execution of process
CHARACTERISTICS OF ROUND-ROBIN
• Round-robin is pre-emptive algorithm
• It is a hybrid model which is clock-driven
• It is a real time algorithm which responds to the event within a specific time limit
• Round-robin is one of the oldest, fairest and easiest algorithm
• Widely used scheduling method in traditional O.S
EXAMPLES OF ROUND-ROBIN SCHEDULING
PROCESS QUEUE. BURST TIME
P1. 4
P2. 3
P3. 5
EXAMPLE OF ROUND-ROBIN SCHEDULING
• STEP 1: The execution begins with process P1, which has burst time 4.
• Here every process executes for 2 seconds. P2 and P3 are still in the waiting queue
CONTINUATION OF EXAMPLE
• STEP 2: At time=2, P1 is added to the end of the queue and P2 starts executing
EXAMPLE CONT…
• STEP 3: At time=4, P2 is preempted and add at the end of of the queue. P3 starts executing
CONT……
• STEP4: At the time=6, P3 is preempted and add at the end of the queue. P1 starts executing
CONT….
• STEP 5: At time=8, P1 has a burst time of of 4. It has completed execution. P2 starts executing
CONT….
• STEP 6: P2 has a burst time of 3. It has already executed for 2 intervals. At time=9, P2 completes execution. Then P3
starts executing till it completes.
CONT….
• STEP 7: Calculate the average waiting time for above example
ADVANTAGES OF ROUND-ROBIN SCHEDULING
• It doesn’t face the issues of starvation or convey effect
• All the jobs get a fair allocation of CPU
• It deals with all process without any priority
• Easy to assume the worst-case response time for the same Processes. Provided the total number of processes on the run
queue is known
• It gives the best performance in terms of average response time
DISADVANTAGES OF ROUND-ROBIN SCHEDULING
• This method spends more time on context switching
• Its performance heavily depends on time quantum
• Priorities cannot be set for the processes
• It doesn’t give special priority to more important tasks

More Related Content

Similar to Presentation.pdf

Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptxSanad Bhowmik
 
Lecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdfLecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdfHarika Pudugosula
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systemsRAMPRAKASHT1
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Maitree Patel
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .nathansel1
 
Operating System Process Management.pptx
Operating System Process Management.pptxOperating System Process Management.pptx
Operating System Process Management.pptxminaltmv
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsBalaji Vignesh
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptxSHUJEHASSAN
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaioninayat khan
 
Operating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingOperating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingVaibhav Khanna
 

Similar to Presentation.pdf (20)

Lecture 4 process cpu scheduling
Lecture 4   process cpu schedulingLecture 4   process cpu scheduling
Lecture 4 process cpu scheduling
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
Lecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdfLecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdf
 
Operating System.pptx
Operating System.pptxOperating System.pptx
Operating System.pptx
 
UNIT I-Processes.pptx
UNIT I-Processes.pptxUNIT I-Processes.pptx
UNIT I-Processes.pptx
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Lecture 2 process
Lecture 2   processLecture 2   process
Lecture 2 process
 
CPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdfCPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdf
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Operating System Process Management.pptx
Operating System Process Management.pptxOperating System Process Management.pptx
Operating System Process Management.pptx
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Unit 1 Computer organization and Instructions
Unit 1 Computer organization and InstructionsUnit 1 Computer organization and Instructions
Unit 1 Computer organization and Instructions
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptx
 
Schudling os presentaion
Schudling os presentaionSchudling os presentaion
Schudling os presentaion
 
Operating system 28 fundamental of scheduling
Operating system 28 fundamental of schedulingOperating system 28 fundamental of scheduling
Operating system 28 fundamental of scheduling
 
Operating system 2 by adi
Operating system 2 by adiOperating system 2 by adi
Operating system 2 by adi
 

Recently uploaded

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Recently uploaded (20)

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Presentation.pdf

  • 2. GROUP MEMBERS • CLEMENT CHULU • FLAVIOUR CHIPAMBA • SAMUEL SIANAMATE • BLESSINGTON MUSONDA • HAPPY NG’AMBI
  • 3. PROCESS SCHEDULING • Proceess scheduling is an Operating System(O.S) task that schedules processes of different states like ready, waiting and running • It allows O.S to allocate a time interval of CPU execution for each process • It is very important because it keeps the CPU busy all the time
  • 4. PROCESS SCHEDULING QUEUES • A queue is simply a collection of processes n storage that are waiting to be brought into memory to run a program • Therefore, PSQ help the user to maintain a distinct queue for each and every process States and Printed CircuitBoards (PCBs) • This is done in such a waythat all processes of the same execution state are placed in the same queue 1. Job queue: keeps or stores all the processesin the system 2. Ready queue: keeps a set of all processesresiding in main memory which are ready and waitingto execute 3. Device queue: constitutes of processeswhich are blocked due to unavailability of I/O device
  • 5. OVERVIEW OF PROCESS SCHEDULING
  • 6. TWO STATE PROCESS MODEL 1. Running state: In the O.S, whenever a new process is built, it is entered into the system which should be running 2. Not Running state: Processes that are not running are kept in a queue, which is waiting for their turn to execute
  • 7. SCHEDULING OBJECTIVES • Maximize the number of interactive users within acceptable response times • Achieve a balance between response and utilization • Avoid definite postponement and enforce priorities • It also should give reference to the processes holding the key resources
  • 8. TYPES OF PROCESS SCHEDULRS • A scheduler is a type of system software that allows the user to handle process scheduling • There are mainly three types of schedulers: 1. LONG TERM SCHEDULER- This is also known as the job scheduler. It regulates the program and select process from the queue and leads them into memory for execution • It’s main is to offer a balanced mix of jobs like processor, I/O jobs, that allow managing multiprogramming 2. MEDIUM TERM SCHEDULER- It’s an important part of swapping, for it enables the user to handle the swapped out-processes • In this scheduler, a running process can become suspended. Which makes I/O request. • A suspended process can’t make progress toward completion. In order to remove the process from memory and make space for other processes. The suspended process should be moved to secondary storage 3. SHORT TERM SCHEDULER-This is also known as CPU scheduler • Its main goal is to boost the system performance according to set criteria • This helps the user to select from a group of processes that are ready to execute and allocates CPUto one of them
  • 9. DIFFERENCE BETWEEN SCHEDULRS LONG TERM SHORT TERM MIDDLE TERM • It’s also known as job scheduler • Also known as a CPU scheduler • Is also called swapping scheduler • It’s either absent or minimal in a time sharing system • It is significant in the time sharing order • It’s an element of Time-sharing systems • Speed is less compared to the short term scheduler • Speed is the fastest compared to the long term and medium term scheduler • It offers medium speed • Allows user to select process from the loads and pool back into the memory • It only selects processes that is in a ready state of the execution • It helps users to send process back to memory • Offers full control • Offers less control • Reduce the level of multiprogramming
  • 10. PSEUDO CODE CONCEPTS • Pseudocode is a simple wayof writing programming code in English • It is not actual programming language • It is offen used in all various fields of programming, wether it be app development, data science, or web development • Pseudocode is a technique used to describe the distinctsteps of an algorithm in a manner that is easy to understand for anyone with basic programming knowledge • It uses short terms or simple English language syntaxesto writecode for programs before it is actually converted into a specific programming language
  • 11. MAIN CONSTRUCTS OF PSEUDO CODE • The core of pseudocode is the ability to represent 6 programming constructs.( Always written in upper case): SEQUENCE, CASE, WHILE, REPEAT-UNTIL, FOR and IF-THEN-ELSE • These constructs also called keywords are used to describe the control flow of the algorithm • SEQUENCE: Represents linear tasks sequentially performed one after the other • WHILE: A loop with a condition at it’s beginning • REPEAT-UNTIL: A loop with a condition at the bottom • FOR: Another way of looping • IF-THEN-ELSE: A condition statement changing the flow of the algorithm • CASE: The generalizationform of IF-THEN-ELSE
  • 12. RULES FOR PSEUDOCODE • Example; • TASK LIST: Read name, hourlyrate, hoursworked, deduction rate, Perform calculations grossPay=hourly Rate*hourly Worked deduuction=gross pay*deduction Rate netPay=grossPay – deduction Write name, grossdeduction, netpay • PSEUDOCODE READname, hourlyRate,hours worked,deductionRate grossPay=hourlyRate*hourlyWorked deduction=grossPay*deductionRate netPay= grossPay– deduction WRITE name, grossPay, deduction,netPay
  • 13. RULES FOR PSEUDOCODE 1. WRITE ONLY 1 STATEMENT PER LINE • Each statement should express just one action for the computer 2. CAPITALIZE INITIAL KEY WORDS • In the above example, READ and WRITE are in caps • There are just a few keywords used • READ, WRITE, IF, ELSE,END IF, WHILE, END WHILE, REPEAT-UNTIL 3. INDENT TO SHOW HIERARCHY • A particular indentation pattern in each of the design structure is used: • SEQUENCE – Keeps the statements that are stacked in sequence all starting in the same column • SELECTION – Indent the statements that fall inside the selection structure, but not the key words that form the selection • LOOPING – Indent the statements that fall inside the loop,but not keywords that form the loop - In the above example, employeeswhose grossPayisless than 100 do nothave anydeduction.E.g:
  • 14. RULES FOR PSEUDOCODE 4 . END MULTILINE STRUCTURES • See how the IF/ELSE/END IF is constructedabove • The END IF or ( END Whatever) always is in line with the IF or (whatever starts thestructure). 5. KEEP STATEMENTS LANGUAGE INDEPENDENT • Resist the urge to write in whatever languageyou are most comfortablewith • It saves time in a long run!
  • 15. • ADVANTAGES OF PSEUDO CODE • It can quickly and easily converted into an actual programming language as it is similar to a programming language • It is fairly easy to understand, even for non programmers • It doesn’t matter if there are errors in the syntax. It is usually still obvious what is intended • Changes to the design can be incorporated quite easily
  • 16. DISADVANTAGES OF PSEUDO CODE • It can be hard to see how a program flows.e.g; where does following one path as opposed to another take the program? • It can be time consuming to produce
  • 17. EXAMPLE OF WHAT IT LOOKS LIKE
  • 18. SCHEDULING ALGORITHM (ROUND-ROBIN) • The name of this algorithm comes from the round-robin principal, where each person gets an equal share of something in turns • In round-robin scheduling, each ready task runs turn by turn only in a cyclic queue for a limited time slice • This algorithm also offers starvation free execution of process
  • 19. CHARACTERISTICS OF ROUND-ROBIN • Round-robin is pre-emptive algorithm • It is a hybrid model which is clock-driven • It is a real time algorithm which responds to the event within a specific time limit • Round-robin is one of the oldest, fairest and easiest algorithm • Widely used scheduling method in traditional O.S
  • 20. EXAMPLES OF ROUND-ROBIN SCHEDULING PROCESS QUEUE. BURST TIME P1. 4 P2. 3 P3. 5
  • 21. EXAMPLE OF ROUND-ROBIN SCHEDULING • STEP 1: The execution begins with process P1, which has burst time 4. • Here every process executes for 2 seconds. P2 and P3 are still in the waiting queue
  • 22. CONTINUATION OF EXAMPLE • STEP 2: At time=2, P1 is added to the end of the queue and P2 starts executing
  • 23. EXAMPLE CONT… • STEP 3: At time=4, P2 is preempted and add at the end of of the queue. P3 starts executing
  • 24. CONT…… • STEP4: At the time=6, P3 is preempted and add at the end of the queue. P1 starts executing
  • 25. CONT…. • STEP 5: At time=8, P1 has a burst time of of 4. It has completed execution. P2 starts executing
  • 26. CONT…. • STEP 6: P2 has a burst time of 3. It has already executed for 2 intervals. At time=9, P2 completes execution. Then P3 starts executing till it completes.
  • 27. CONT…. • STEP 7: Calculate the average waiting time for above example
  • 28. ADVANTAGES OF ROUND-ROBIN SCHEDULING • It doesn’t face the issues of starvation or convey effect • All the jobs get a fair allocation of CPU • It deals with all process without any priority • Easy to assume the worst-case response time for the same Processes. Provided the total number of processes on the run queue is known • It gives the best performance in terms of average response time
  • 29. DISADVANTAGES OF ROUND-ROBIN SCHEDULING • This method spends more time on context switching • Its performance heavily depends on time quantum • Priorities cannot be set for the processes • It doesn’t give special priority to more important tasks