2
Most read
13
Most read
18
Most read
CHAPTER 7
CPU SCHEDULING: BASIC CONCEPTS, SCHEDULING CRITERIA,
SCHEDULING ALGORITHMS, ALGORITHM EVALUATION
CPU SCHEDULING CRITERIA
• Definition: CPU scheduling is a crucial part of operating systems that determines the order and priority of processes to
run on a CPU at any given moment.
• Purpose: It allows multiple processes to run concurrently on the same processor, optimizing system performance.
• Functionality: The CPU scheduler allocates CPU time to processes based on parameters like CPU usage, throughput,
turnaround, waiting time, and response time.
• Importance: Ensures correct and timely execution of processes, contributing to overall system efficiency.
• Algorithms: Different CPU scheduling algorithms exist, each with distinct properties. The choice of algorithm depends
on factors such as system requirements and priorities.
• Criteria for Comparison: Various criteria, including CPU usage, throughput, turnaround time, waiting time, and
response time, are used to compare and evaluate the effectiveness of CPU scheduling algorithms.
CPU Scheduling in Operating Systems
• Objective: CPU scheduling aims to complete work on time by efficiently utilizing the CPU, allowing one process to use
it while others are in standby due to resource unavailability.
• Resource Utilization: CPU scheduling ensures optimal use of the CPU by allowing processes to run when others are
delayed, such as waiting for I/O resources.
• System Improvement: The purpose is to enhance system efficiency, speed, and fairness, ensuring that processes are
executed in a timely and equitable manner.
• Idle CPU Handling: When the CPU is idle, the operating system's temporary scheduler selects a process from the ready
queue, which contains processes prepared for execution.
• Launching Processes: The selected process is assigned the CPU for execution, ensuring a continuous flow of tasks and
preventing unnecessary CPU downtime.
• Temporary Scheduler: The temporary scheduler plays a crucial role in selecting processes for execution, managing the
flow of tasks when the CPU becomes available.
States of a Process in Operating Systems
States of a Process in Operating Systems
• New (Create):
• Process is about to be created but not yet created.
• Program in secondary memory picked up by OS to create the process.
• Ready:
• Follows the "New" state.
• Process is loaded into main memory.
• Ready to run and waiting for CPU time.
• Maintained in a queue called the ready queue.
• Run:
• Process chosen from ready queue for execution.
• Instructions within the process are executed by a CPU core.
• Blocked or Wait:
• Occurs when process requests I/O, user input, or access to a critical region.
• Process enters a waiting state, not requiring CPU.
• Resumes to the ready state once I/O or critical region access is complete.
States of a Process in Operating Systems
• Terminated or Completed:
• Process is killed, and PCB (Process Control Block) is deleted.
• Resources allocated to the process are released or deallocated.
• Suspend Ready:
• Process initially in ready state but swapped out of main memory.
• Placed onto external storage by the scheduler.
• Transitions back to ready state when brought back to main memory.
• Suspend Wait or Suspend Blocked:
• Similar to Suspend Ready but involves processes performing I/O operations.
• Lack of main memory causes them to move to secondary memory.
• Transitions back to Suspend Ready after completing the task.
• CPU and I/O Bound Processes:
• CPU Bound Process: Intensive in CPU operations.
• I/O Bound Process: Intensive in I/O operations.
How does a process move between different states in an
operating system?
A process can move between different states in an operating system based on its execution
status and resource availability.
• New to Ready:
• Process is created and in the new state.
• Moves to the ready state when the operating system allocates necessary
resources.
• Ready to Running:
• CPU becomes available.
• Operating system selects a process from the ready queue based on
scheduling algorithms.
• Process moves to the running state for execution.
• Running to Blocked:
• Process needs to wait for an event (e.g., I/O operation or system call).
• Moves to the blocked state until the required event occurs.
How does a process move between different states in an
operating system?
A process can move between different states in an operating system based on its execution
status and resource availability.
• Running to Ready:
• Running process is preempted by the operating system.
• Moves to the ready state, often due to a higher-priority process becoming
ready.
• Blocked to Ready:
• Event a blocked process was waiting for occurs.
• Process moves to the ready state, ready for execution.
• Running to Terminated:
• Process completes execution or is terminated by the operating system.
• Moves to the terminated state.
Type of Scheduler in Operating Systems
Types of Schedulers – Short, Middle & Long Term
• Long-term Scheduler (Job Scheduler):
• Objective: Determines how many processes should stay in the ready
state, deciding the degree of multiprogramming.
• Frequency: Runs infrequently, as its decisions last for a long time.
• Impact: Influences overall system performance by controlling the
number of processes in the ready state.
Types of Schedulers - Short, Middle & Long Term
• Short-term Scheduler (CPU Scheduler):
• Objective: Decides which process to execute next and initiates context
switching.
• Dispatcher: Utilizes a dispatcher (software) to move processes between
ready and running states.
• Frequency: Runs frequently, managing the immediate execution of
processes.
• Alias: Also known as the CPU scheduler.
Types of Schedulers - Short, Middle & Long Term
• Middle-term Scheduler:
• Objective: Makes decisions regarding process suspension, especially for
swapping between main memory and secondary storage.
• Swapping: Involves moving processes to and from main memory to
optimize resource usage.
• Frequency: Runs when needed, typically to manage the degree of
multiprogramming.
• Impact: Affects system performance by regulating the presence of
processes in main memory.
Multiprogramming
• Preemption – Process is forcefully removed from CPU.
Pre-emotion is also called time sharing or multitasking.
• Non-preemption – Processes are not removed until they
complete the execution. Once control is given to the CPU for a
process execution, till the CPU releases the control by itself,
control cannot be taken back forcibly from the CPU.
Operation on the Process
• 1. Creation: The process will be ready once it has been created, enter the ready queue (main
memory), and be prepared for execution.
• 2. Planning: The operating system picks one process to begin executing from among the
numerous processes that are currently in the ready queue. Scheduling is the process of
choosing the next process to run.
• 3. Application: The processor begins running the process as soon as it is scheduled to run.
During execution, a process may become blocked or wait, at which point the processor
switches to executing the other processes.
• 4. Killing or Deletion: The OS will terminate the process once its purpose has been fulfilled.
The process’s context will be over there.
Multiple Choice Questions
1. What is the purpose of the Long-term Scheduler in an operating system?
• A) Decides process execution order
• B) Manages context switching
• C) Determines degree of multiprogramming
• D) Handles I/O operations
2. Which scheduler runs infrequently and influences the overall system performance?
• A) Short-term Scheduler
• B) Long-term Scheduler
• C) Medium-term Scheduler
• D) CPU Scheduler
Multiple Choice Questions
3. What does the Short-term Scheduler (CPU Scheduler) primarily decide?
• A) Degree of multiprogramming
• B) Process suspension
• C) Process execution order
• D) Swapping decisions
4. What is the primary function of the Medium-term Scheduler?
• A) Determines degree of multiprogramming
• B) Manages context switching
• C) Makes decisions about process suspension and swapping
• D) Allocates CPU time
Multiple Choice Questions
5. When does a process move from the Ready to Running state in the context of scheduling?
• A) When it completes execution
• B) When the CPU becomes available
• C) When it needs to wait for an event
• D) When a higher-priority process becomes ready
6. What is the primary purpose of context switching in an operating system?
• A) Allocating CPU time to processes
• B) Saving and restoring the CPU state for process switching
• C) Making decisions about process suspension
• D) Determining the degree of multiprogramming
Multiple Choice Questions
7. In which state does a process wait for an event, such as I/O operation or user input?
• A) Ready
• B) Blocked or Wait
• C) Running
• D) Terminated
8. When does a process move from the Running to the Ready state?
• A) When it completes execution
• B) When it needs to wait for an event
• C) When preempted by the operating system
• D) When the CPU becomes available
Multiple Choice Questions
9. What is the role of the dispatcher in the context of scheduling?
• A) Determines degree of multiprogramming
• B) Manages context switching
• C) Allocates CPU time to processes
• D) Makes decisions about process suspension
10. What does the term "CPU Bound Process" refer to?
• A) Intensive in I/O operations
• B) Intensive in CPU operations
• C) Ready for execution
• D) Completed its execution

More Related Content

PPTX
Unit 2_OS process management
PDF
Process management- This ppt contains all required information regarding oper...
PPTX
Lecture 4 process cpu scheduling
PPTX
Operating system 28 fundamental of scheduling
PPTX
Process management1
PDF
CPU Scheduling Part-I.pdf
PPTX
Os unit 3 , process management
PPTX
UNIT I-Processes.pptx
Unit 2_OS process management
Process management- This ppt contains all required information regarding oper...
Lecture 4 process cpu scheduling
Operating system 28 fundamental of scheduling
Process management1
CPU Scheduling Part-I.pdf
Os unit 3 , process management
UNIT I-Processes.pptx

Similar to CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx (20)

PPTX
UNIT 2 OS.pptx Introduction of Operating System
PPTX
Scheduling Definition, objectives and types
PPTX
Lecture 4 - Process Scheduling.pptx
PPTX
Lecture 4 - Process Scheduling (1).pptx
PPTX
THEPROCESS SCHEDULING BASIC CONCEPT .pptx
PPTX
Operating System.pptx
PPTX
topic cpu scheduling in operating system.pptx
PPTX
Computer organization and aChapter 2.pptx
PDF
Lecture 2- Processes.pdf
PPTX
Operating Systems chap 2_updated2.pptx
PPTX
In computing, scheduling is the action .
PPTX
PROCESS.pptx
PPTX
Lecture 7 cpu scheduling
PPTX
Operating Systems chap 2_updated2 (1).pptx
PPTX
Process management system in operating system
PPTX
Process management in operating system, process creation, process sheduling
PPTX
How Operating system works.
PPTX
opearating system notes mumbai university.pptx
PPT
its about os process states dfdf dfdfdfdf
PPTX
Schudling os presentaion
UNIT 2 OS.pptx Introduction of Operating System
Scheduling Definition, objectives and types
Lecture 4 - Process Scheduling.pptx
Lecture 4 - Process Scheduling (1).pptx
THEPROCESS SCHEDULING BASIC CONCEPT .pptx
Operating System.pptx
topic cpu scheduling in operating system.pptx
Computer organization and aChapter 2.pptx
Lecture 2- Processes.pdf
Operating Systems chap 2_updated2.pptx
In computing, scheduling is the action .
PROCESS.pptx
Lecture 7 cpu scheduling
Operating Systems chap 2_updated2 (1).pptx
Process management system in operating system
Process management in operating system, process creation, process sheduling
How Operating system works.
opearating system notes mumbai university.pptx
its about os process states dfdf dfdfdfdf
Schudling os presentaion
Ad

More from TSha7 (20)

PPTX
Computer_Graphics_Presentationa (1).pptx
 
PPTX
Guidelines and Examples.pptxGuidelines and Examples.pptx
 
PPTX
01-introduction-130924015121-phpapp02.pptx
 
PPTX
Core-Challenges-in-Supply-Chain-for-Minimising-Operational-Waste-in-the-Manuf...
 
PPTX
Computer-Graphics Fundamentals of Computer Graphics
 
PPTX
Fundamentalsss-of-Computer-Graphics.pptx
 
PPTX
electronicpaymentppt-140601022736-phpapp02.pptx
 
PPT
5-170401094214-1704010942145-170401094214.ppt
 
PDF
operating system in computer science .pdf
 
PDF
operating system in computer science ch05.pdf
 
PPTX
nursing researvh RESEARCH PROPOSAL SLIDE.pptx
 
PPTX
Streamlining Collaboration and Development - cloud computing .pptx
 
PPTX
CHAPTER 7 Legal Issues in E-Commerce: A Beginner's Guide
 
PPTX
CHAPTER 3 oop with programming java language
 
PPTX
CHAPTER 5 oop chapter 5 programming sem2
 
PPTX
CHAPTER 6 oop with c++ chapter programming
 
PDF
introduction to Python and Computer Programming.pdf
 
PDF
Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
 
PDF
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
 
PPTX
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
 
Computer_Graphics_Presentationa (1).pptx
 
Guidelines and Examples.pptxGuidelines and Examples.pptx
 
01-introduction-130924015121-phpapp02.pptx
 
Core-Challenges-in-Supply-Chain-for-Minimising-Operational-Waste-in-the-Manuf...
 
Computer-Graphics Fundamentals of Computer Graphics
 
Fundamentalsss-of-Computer-Graphics.pptx
 
electronicpaymentppt-140601022736-phpapp02.pptx
 
5-170401094214-1704010942145-170401094214.ppt
 
operating system in computer science .pdf
 
operating system in computer science ch05.pdf
 
nursing researvh RESEARCH PROPOSAL SLIDE.pptx
 
Streamlining Collaboration and Development - cloud computing .pptx
 
CHAPTER 7 Legal Issues in E-Commerce: A Beginner's Guide
 
CHAPTER 3 oop with programming java language
 
CHAPTER 5 oop chapter 5 programming sem2
 
CHAPTER 6 oop with c++ chapter programming
 
introduction to Python and Computer Programming.pdf
 
Lect 1b - Introduction to Pharmacy Informatics 1b.pdf
 
Lect 1a - Introduction to Pharmacy Informatics 1a.pdf
 
APznzabZBYmM9xNVBHfOxhzhAYK6CVARVaOcFQRGQ_SDH3ZHiu4lPbmPUi4L1H3zAkRth3WEwZR2u...
 
Ad

Recently uploaded (20)

DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
International_Financial_Reporting_Standa.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
 
PDF
HVAC Specification 2024 according to central public works department
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
20th Century Theater, Methods, History.pptx
PPTX
Computer Architecture Input Output Memory.pptx
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
International_Financial_Reporting_Standa.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Unit 4 Computer Architecture Multicore Processor.pptx
History, Philosophy and sociology of education (1).pptx
 
HVAC Specification 2024 according to central public works department
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Weekly quiz Compilation Jan -July 25.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Paper A Mock Exam 9_ Attempt review.pdf.
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Hazard Identification & Risk Assessment .pdf
20th Century Theater, Methods, History.pptx
Computer Architecture Input Output Memory.pptx
Virtual and Augmented Reality in Current Scenario
TNA_Presentation-1-Final(SAVE)) (1).pptx
What if we spent less time fighting change, and more time building what’s rig...
My India Quiz Book_20210205121199924.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Environmental Education MCQ BD2EE - Share Source.pdf

CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx

  • 1. CHAPTER 7 CPU SCHEDULING: BASIC CONCEPTS, SCHEDULING CRITERIA, SCHEDULING ALGORITHMS, ALGORITHM EVALUATION
  • 2. CPU SCHEDULING CRITERIA • Definition: CPU scheduling is a crucial part of operating systems that determines the order and priority of processes to run on a CPU at any given moment. • Purpose: It allows multiple processes to run concurrently on the same processor, optimizing system performance. • Functionality: The CPU scheduler allocates CPU time to processes based on parameters like CPU usage, throughput, turnaround, waiting time, and response time. • Importance: Ensures correct and timely execution of processes, contributing to overall system efficiency. • Algorithms: Different CPU scheduling algorithms exist, each with distinct properties. The choice of algorithm depends on factors such as system requirements and priorities. • Criteria for Comparison: Various criteria, including CPU usage, throughput, turnaround time, waiting time, and response time, are used to compare and evaluate the effectiveness of CPU scheduling algorithms.
  • 3. CPU Scheduling in Operating Systems • Objective: CPU scheduling aims to complete work on time by efficiently utilizing the CPU, allowing one process to use it while others are in standby due to resource unavailability. • Resource Utilization: CPU scheduling ensures optimal use of the CPU by allowing processes to run when others are delayed, such as waiting for I/O resources. • System Improvement: The purpose is to enhance system efficiency, speed, and fairness, ensuring that processes are executed in a timely and equitable manner. • Idle CPU Handling: When the CPU is idle, the operating system's temporary scheduler selects a process from the ready queue, which contains processes prepared for execution. • Launching Processes: The selected process is assigned the CPU for execution, ensuring a continuous flow of tasks and preventing unnecessary CPU downtime. • Temporary Scheduler: The temporary scheduler plays a crucial role in selecting processes for execution, managing the flow of tasks when the CPU becomes available.
  • 4. States of a Process in Operating Systems
  • 5. States of a Process in Operating Systems • New (Create): • Process is about to be created but not yet created. • Program in secondary memory picked up by OS to create the process. • Ready: • Follows the "New" state. • Process is loaded into main memory. • Ready to run and waiting for CPU time. • Maintained in a queue called the ready queue. • Run: • Process chosen from ready queue for execution. • Instructions within the process are executed by a CPU core. • Blocked or Wait: • Occurs when process requests I/O, user input, or access to a critical region. • Process enters a waiting state, not requiring CPU. • Resumes to the ready state once I/O or critical region access is complete.
  • 6. States of a Process in Operating Systems • Terminated or Completed: • Process is killed, and PCB (Process Control Block) is deleted. • Resources allocated to the process are released or deallocated. • Suspend Ready: • Process initially in ready state but swapped out of main memory. • Placed onto external storage by the scheduler. • Transitions back to ready state when brought back to main memory. • Suspend Wait or Suspend Blocked: • Similar to Suspend Ready but involves processes performing I/O operations. • Lack of main memory causes them to move to secondary memory. • Transitions back to Suspend Ready after completing the task. • CPU and I/O Bound Processes: • CPU Bound Process: Intensive in CPU operations. • I/O Bound Process: Intensive in I/O operations.
  • 7. How does a process move between different states in an operating system? A process can move between different states in an operating system based on its execution status and resource availability. • New to Ready: • Process is created and in the new state. • Moves to the ready state when the operating system allocates necessary resources. • Ready to Running: • CPU becomes available. • Operating system selects a process from the ready queue based on scheduling algorithms. • Process moves to the running state for execution. • Running to Blocked: • Process needs to wait for an event (e.g., I/O operation or system call). • Moves to the blocked state until the required event occurs.
  • 8. How does a process move between different states in an operating system? A process can move between different states in an operating system based on its execution status and resource availability. • Running to Ready: • Running process is preempted by the operating system. • Moves to the ready state, often due to a higher-priority process becoming ready. • Blocked to Ready: • Event a blocked process was waiting for occurs. • Process moves to the ready state, ready for execution. • Running to Terminated: • Process completes execution or is terminated by the operating system. • Moves to the terminated state.
  • 9. Type of Scheduler in Operating Systems
  • 10. Types of Schedulers – Short, Middle & Long Term • Long-term Scheduler (Job Scheduler): • Objective: Determines how many processes should stay in the ready state, deciding the degree of multiprogramming. • Frequency: Runs infrequently, as its decisions last for a long time. • Impact: Influences overall system performance by controlling the number of processes in the ready state.
  • 11. Types of Schedulers - Short, Middle & Long Term • Short-term Scheduler (CPU Scheduler): • Objective: Decides which process to execute next and initiates context switching. • Dispatcher: Utilizes a dispatcher (software) to move processes between ready and running states. • Frequency: Runs frequently, managing the immediate execution of processes. • Alias: Also known as the CPU scheduler.
  • 12. Types of Schedulers - Short, Middle & Long Term • Middle-term Scheduler: • Objective: Makes decisions regarding process suspension, especially for swapping between main memory and secondary storage. • Swapping: Involves moving processes to and from main memory to optimize resource usage. • Frequency: Runs when needed, typically to manage the degree of multiprogramming. • Impact: Affects system performance by regulating the presence of processes in main memory.
  • 13. Multiprogramming • Preemption – Process is forcefully removed from CPU. Pre-emotion is also called time sharing or multitasking. • Non-preemption – Processes are not removed until they complete the execution. Once control is given to the CPU for a process execution, till the CPU releases the control by itself, control cannot be taken back forcibly from the CPU.
  • 14. Operation on the Process • 1. Creation: The process will be ready once it has been created, enter the ready queue (main memory), and be prepared for execution. • 2. Planning: The operating system picks one process to begin executing from among the numerous processes that are currently in the ready queue. Scheduling is the process of choosing the next process to run. • 3. Application: The processor begins running the process as soon as it is scheduled to run. During execution, a process may become blocked or wait, at which point the processor switches to executing the other processes. • 4. Killing or Deletion: The OS will terminate the process once its purpose has been fulfilled. The process’s context will be over there.
  • 15. Multiple Choice Questions 1. What is the purpose of the Long-term Scheduler in an operating system? • A) Decides process execution order • B) Manages context switching • C) Determines degree of multiprogramming • D) Handles I/O operations 2. Which scheduler runs infrequently and influences the overall system performance? • A) Short-term Scheduler • B) Long-term Scheduler • C) Medium-term Scheduler • D) CPU Scheduler
  • 16. Multiple Choice Questions 3. What does the Short-term Scheduler (CPU Scheduler) primarily decide? • A) Degree of multiprogramming • B) Process suspension • C) Process execution order • D) Swapping decisions 4. What is the primary function of the Medium-term Scheduler? • A) Determines degree of multiprogramming • B) Manages context switching • C) Makes decisions about process suspension and swapping • D) Allocates CPU time
  • 17. Multiple Choice Questions 5. When does a process move from the Ready to Running state in the context of scheduling? • A) When it completes execution • B) When the CPU becomes available • C) When it needs to wait for an event • D) When a higher-priority process becomes ready 6. What is the primary purpose of context switching in an operating system? • A) Allocating CPU time to processes • B) Saving and restoring the CPU state for process switching • C) Making decisions about process suspension • D) Determining the degree of multiprogramming
  • 18. Multiple Choice Questions 7. In which state does a process wait for an event, such as I/O operation or user input? • A) Ready • B) Blocked or Wait • C) Running • D) Terminated 8. When does a process move from the Running to the Ready state? • A) When it completes execution • B) When it needs to wait for an event • C) When preempted by the operating system • D) When the CPU becomes available
  • 19. Multiple Choice Questions 9. What is the role of the dispatcher in the context of scheduling? • A) Determines degree of multiprogramming • B) Manages context switching • C) Allocates CPU time to processes • D) Makes decisions about process suspension 10. What does the term "CPU Bound Process" refer to? • A) Intensive in I/O operations • B) Intensive in CPU operations • C) Ready for execution • D) Completed its execution