SlideShare a Scribd company logo
Assignment: CPU Scheduling & process Synchronizing
Submitted By: Usman Farooq
Department: BSSE
Semester 4th
Submitted To:
Sir Farhan
Afro Assian Institute Affiliated with GCUF
CPU Scheduling and Algorithm
Basic Concept:
Main objective of multiprogramming is to keep on running processes all the
time for maximum CPU utilization.
Scheduling is fundamental function of OS.
The task of selecting the processes in memory that are ready to execute,
and allocating them to the CPU is performed by the CPU Scheduler.
CPU Scheduler:
Types of CPU Scheduler:
There are two types of CPU Scheduler.
1-Prremptive
2- non-preemptive.
1-preemptive:
Once a process is allocated the CPU, it does not leave unless:
it has to wait, e.g., for I/O request
it terminates
2-Non-preemptive:
OS can force (preempt) a process from CPU at anytime
E.g., to allocate CPU to another higher-priority process
Scheduling Criteria:
CPU utilization: keep the CPU as busy as possible Maximize.
Throughput: No of processes that complete their execution per time unit
Maximize
Turnaround time: amount of time to execute a particular process (time
from submission to termination) Minimize
Waiting time: amount of time a process has been waiting in the ready
queue (sum of time waiting in ready queue) Minimize
Response time: amount of time it takes from when a request was
submitted until the first response is produced, not output (for time-sharing
environment) Minimize
Scheduling Algorithms:
First Come, First Served
Shortest Job First
Priority
Round Robin
Implementation in C++:
Source Code (.c)
Compiler
Executable
Windows Micro Kernel
Memory CPU
Process synchronizing in operating system
Process Synchronization means sharing system resources
by processes in a such a way that, Concurrent access to shared data is
handled thereby minimizing the chance of inconsistent data. Maintaining
data consistency demands mechanisms to
ensure synchronized execution of cooperating processes.
Race Condition:
A race condition is an undesirable situation that occurs when a device or
system attempts to perform two or more operations at the same time, but
because of the nature of the device or system, the operations must be
done in the proper sequence to be done correctly.
• Threads are racing to access the data
• Different ways race condition can happen:
• Kernel preemption • Parallel processing
Critical Condition:
The critical section is a code segment where the shared variables
can be accessed. An atomic action is required in a critical section i.e. only
one process can execute in its critical section at a time. All the other
processes have to wait to execute in their critical sections.
Solution to the Critical Section Problem
The critical section problem needs a solution to synchronize the different
processes. The solution to the critical section problem must satisfy the
following conditions −
 Mutual Exclusion
Mutual exclusion implies that only one process can be inside the critical
section at any time. If any other processes require the critical section,
they must wait until it is free.
 Progress
Progress means that if a process is not using the critical section, then
it should not stop any other process from accessing it. In other words,
any process can enter a critical section if it is free.
 Bounded Waiting
Bounded waiting means that each process must have a limited waiting
time. Itt should not wait endlessly to access the critical section

More Related Content

PPTX
Process Management
PPT
OS Process and Thread Concepts
PPTX
Windows process scheduling presentation
PPTX
The Functions of the Operating System
PPTX
The Functions of the Operating System
PPTX
Process in operating system
PDF
cpu scheduling by shivam singh
PPTX
Windows process-scheduling
Process Management
OS Process and Thread Concepts
Windows process scheduling presentation
The Functions of the Operating System
The Functions of the Operating System
Process in operating system
cpu scheduling by shivam singh
Windows process-scheduling

What's hot (19)

PPTX
Real time operating systems (rtos) concepts 3
PPT
The Windows Scheduler
PPT
Multiprocessor scheduling 1
PPTX
Lecture 5 process concept
DOCX
Operating system Q/A
PPT
Process management in os
PPTX
Process state in OS
PPTX
Real time operating systems (rtos) concepts 4
PDF
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
PPTX
Real time operating systems (rtos) concepts 5
PPTX
Scheduling Algorithm
PPTX
Process scheduling algorithms
PPT
Multiprocessor scheduling 2
PPTX
SCHEDULING ALGORITHMS
PPTX
Processing management
PPT
OS Chapter03
PDF
Welcome to International Journal of Engineering Research and Development (IJERD)
PPTX
Cpu scheduling in operating System.
PPTX
MULTILEVEL QUEUE SCHEDULING
Real time operating systems (rtos) concepts 3
The Windows Scheduler
Multiprocessor scheduling 1
Lecture 5 process concept
Operating system Q/A
Process management in os
Process state in OS
Real time operating systems (rtos) concepts 4
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Real time operating systems (rtos) concepts 5
Scheduling Algorithm
Process scheduling algorithms
Multiprocessor scheduling 2
SCHEDULING ALGORITHMS
Processing management
OS Chapter03
Welcome to International Journal of Engineering Research and Development (IJERD)
Cpu scheduling in operating System.
MULTILEVEL QUEUE SCHEDULING
Ad

Similar to Cpu scheduling & process synchronizing (20)

PPTX
Process management in Operating System_Unit-2
PPT
Intro Basic of OS .ppt
PPTX
Chapter 5. Concurrency: Mutual Exclusion and Synchronization
PDF
Concurrency in Operating system_12345678
PDF
OS Process synchronization Unit3 synchronization
PPTX
operating system notes of unit 3 explanation
PPT
Mutual exclusion and sync
PPTX
process synchronization topic of operating system
PDF
Lecture 5- Process Synchonization_revised.pdf
PPT
OS Unit 3 ProcessSyncronization in operation g system
PPTX
Chapter 5 - Operating Synchronization.pptx
PPTX
Process Synchronization in operating system | mutex | semaphore | race condition
PPTX
Chapter 6 Concurrency: Deadlock and Starvation
PDF
CH05.pdf
PDF
Operating System: Process and synchronization
PPTX
Lecture 5 inter process communication
PPTX
9-Operating Systems -Synchronization, interprocess communication, deadlock.pptx
PPT
Ipc feb4
PPT
MODERN OPERATING SYSTEMS Chapter02 Processes and Threads.ppt
Process management in Operating System_Unit-2
Intro Basic of OS .ppt
Chapter 5. Concurrency: Mutual Exclusion and Synchronization
Concurrency in Operating system_12345678
OS Process synchronization Unit3 synchronization
operating system notes of unit 3 explanation
Mutual exclusion and sync
process synchronization topic of operating system
Lecture 5- Process Synchonization_revised.pdf
OS Unit 3 ProcessSyncronization in operation g system
Chapter 5 - Operating Synchronization.pptx
Process Synchronization in operating system | mutex | semaphore | race condition
Chapter 6 Concurrency: Deadlock and Starvation
CH05.pdf
Operating System: Process and synchronization
Lecture 5 inter process communication
9-Operating Systems -Synchronization, interprocess communication, deadlock.pptx
Ipc feb4
MODERN OPERATING SYSTEMS Chapter02 Processes and Threads.ppt
Ad

Recently uploaded (20)

PPTX
assetexplorer- product-overview - presentation
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
ai tools demonstartion for schools and inter college
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
System and Network Administraation Chapter 3
PDF
Nekopoi APK 2025 free lastest update
PDF
Digital Strategies for Manufacturing Companies
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Transform Your Business with a Software ERP System
assetexplorer- product-overview - presentation
Understanding Forklifts - TECH EHS Solution
Upgrade and Innovation Strategies for SAP ERP Customers
How to Choose the Right IT Partner for Your Business in Malaysia
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ai tools demonstartion for schools and inter college
CHAPTER 2 - PM Management and IT Context
Softaken Excel to vCard Converter Software.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
history of c programming in notes for students .pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Designing Intelligence for the Shop Floor.pdf
System and Network Administraation Chapter 3
Nekopoi APK 2025 free lastest update
Digital Strategies for Manufacturing Companies
How to Migrate SBCGlobal Email to Yahoo Easily
Transform Your Business with a Software ERP System

Cpu scheduling & process synchronizing

  • 1. Assignment: CPU Scheduling & process Synchronizing Submitted By: Usman Farooq Department: BSSE Semester 4th Submitted To: Sir Farhan Afro Assian Institute Affiliated with GCUF
  • 2. CPU Scheduling and Algorithm Basic Concept: Main objective of multiprogramming is to keep on running processes all the time for maximum CPU utilization. Scheduling is fundamental function of OS. The task of selecting the processes in memory that are ready to execute, and allocating them to the CPU is performed by the CPU Scheduler. CPU Scheduler: Types of CPU Scheduler: There are two types of CPU Scheduler. 1-Prremptive 2- non-preemptive. 1-preemptive: Once a process is allocated the CPU, it does not leave unless: it has to wait, e.g., for I/O request it terminates 2-Non-preemptive: OS can force (preempt) a process from CPU at anytime E.g., to allocate CPU to another higher-priority process Scheduling Criteria:
  • 3. CPU utilization: keep the CPU as busy as possible Maximize. Throughput: No of processes that complete their execution per time unit Maximize Turnaround time: amount of time to execute a particular process (time from submission to termination) Minimize Waiting time: amount of time a process has been waiting in the ready queue (sum of time waiting in ready queue) Minimize Response time: amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment) Minimize Scheduling Algorithms: First Come, First Served Shortest Job First Priority Round Robin Implementation in C++: Source Code (.c) Compiler Executable Windows Micro Kernel Memory CPU
  • 4. Process synchronizing in operating system Process Synchronization means sharing system resources by processes in a such a way that, Concurrent access to shared data is handled thereby minimizing the chance of inconsistent data. Maintaining data consistency demands mechanisms to ensure synchronized execution of cooperating processes. Race Condition: A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly. • Threads are racing to access the data • Different ways race condition can happen: • Kernel preemption • Parallel processing Critical Condition: The critical section is a code segment where the shared variables can be accessed. An atomic action is required in a critical section i.e. only one process can execute in its critical section at a time. All the other processes have to wait to execute in their critical sections. Solution to the Critical Section Problem The critical section problem needs a solution to synchronize the different processes. The solution to the critical section problem must satisfy the following conditions −  Mutual Exclusion Mutual exclusion implies that only one process can be inside the critical section at any time. If any other processes require the critical section, they must wait until it is free.  Progress
  • 5. Progress means that if a process is not using the critical section, then it should not stop any other process from accessing it. In other words, any process can enter a critical section if it is free.  Bounded Waiting Bounded waiting means that each process must have a limited waiting time. Itt should not wait endlessly to access the critical section