SlideShare a Scribd company logo
1
2
◦ Muhammed Talha MCS-13-08
◦ Aitazaz Ahsan MCS-13-38
3
 Scheduling
 Scheduling Criteria
 Windows Scheduling
 Priority Schemes
 Thread Priority
 Scheduling Features in Windows
4
 Maximum CPU utilization ? Multiprogramming.
◦ Several processes are kept in memory at one time.
◦ Any process can take over the CPU.
 Process Scheduler is the component of the OS.
 Scheduling of the CPU is fundamental to OS design.
Ref: William Stalling
5
 Assign processes to be executed by the processor over time.
 Meets System objectives:
◦ Response time
◦ Throughput
◦ Processor efficiency
Ref: William Stalling
6
 Scheduling function should:
◦ Share time fairly among processes
◦ Prevent starvation of a process
◦ Use the processor efficiently
◦ Have low overhead
◦ Prioritise processes when necessary
Ref: William Stalling
7
 CPU scheduling is affected by the following :
◦ (N) A process switches from running to waiting state
◦ (P) A process switches from running to ready state
◦ (P) A process switches from waiting to ready state
◦ (N) A process switches from running to terminate
state
 Circumstances 1 and 4 are non pre-emptive; “they offer
no schedule choice”
 Circumstances 2 and 3 are pre-emptive; “they can be
scheduled”
Ref: William Stalling
8
Ref: William Stalling
9
 The dispatcher module gives control of the CPU to the
process selected by the short-term scheduler; this
involves:
◦ switching context
◦ switching to user mode
 The dispatcher needs to run as fast as possible, since it
is invoked during process context switch.
 The time it takes for the dispatcher to stop one process
and start another process is called dispatch latency.
http://en.wikipedia.org/wiki/Scheduling_(computing)
10
 Different CPU scheduling algorithms have different
properties.
 The choice of a particular algorithm may favour one
class of processes over another.
 In choosing which algorithm to use, the properties of the
various algorithms should be considered.
Ref: William Stalling
11
 Criteria for comparing CPU scheduling algorithms may
include:
◦ CPU utilization
◦ Throughput
◦ Turnaround time
◦ Response time
◦ Waiting time
Ref: William Stalling
12
 First Come, First Served (FCFS)
 Shortest Job First (SJF)
 Priority
 Round Robin (RR)
Ref: William Stalling
13
 DOS-Based
◦ Windows 3.1x
 Windows 9x
◦ Windows 95, 98, ME
 Windows NT
◦ 2000, XP, Vista, 7, 8, 10
 Windows Server
◦ 2003, 2008, 2012
 Windows Mobile
 Windows Phone
◦ 7, 8, 10
http://en.wikipedia.org/wiki/Windows_NT
14
 MS-DOS is non-multitasking, and as such did not
feature a schedule.
 Windows 3.1x used a non-preemptive scheduler,
meaning that it did not interrupt programs.
 Windows 95 introduced a rudimentary preemptive
scheduler.
http://en.wikipedia.org/wiki/Scheduling_(computing)
15
 Windows NT-based operating systems use a multilevel
feedback queue. 32 priority levels are defined,
◦ Give preference to short jobs.
◦ Give preference to I/O bound processes.
◦ Quickly establish the nature of a process and schedule
the process accordingly.
All processes receive a priority boost after a wait
event, but processes that have experienced a keyboard
I/O wait get a larger boost than those that have
experienced a disk I/O wait.
http://www.ukessays.com/essays/information-
systems/compare-cpu-scheduling-of-linux-and-
windows.php
16
 Windows XP schedules threads using a priority-based,
pre-emptive scheduler with a flexible system of priority
levels that includes round-robin scheduling within each
level.
 The scheduler ensures that the highest priority thread
will always run.
 The portion of the Windows kernel that handles
scheduling is called the dispatcher.
http://en.wikipedia.org/wiki/Scheduling_(computing)
17
 A thread selected to run by the dispatcher will run until it:
◦ Pre-empted by a higher-priority thread,
◦ Terminates,
◦ Time quantum ends,
◦ Calls a blocking system call such as I/O
 If a higher priority real-time thread becomes ready while
a lower-priority thread is running, lower-priority thread
will be pre-empted.
◦ This pre-emption gives a real-time thread preferential
access to the CPU when the thread needs such
access.
http://en.wikipedia.org/wiki/Scheduling_(computing)
18
http://en.wikipedia.org/wiki/Multilevel_feedback_queue
19
 The dispatcher uses a 32-level priority scheme to
determine the order of thread execution
 Priorities are divided into two classes
◦ The variable class contains threads having priorities 1
to 15
◦ The real-time class contains threads with priorities
ranging from 16 to 31
◦ There is also a thread running at priority 0 that is used
for memory management
Ref: William Stalling
20
 The dispatcher uses a queue for each scheduling priority
and traverses the set of queues from highest to lowest
until it finds a thread that is ready to run
 If no ready thread is found, the dispatcher will execute a
special thread called the idle thread
Ref: William Stalling
21
Ref: William Stalling
22
 The Windows Win32 API identifies six priority classes to
which a process can belong as shown below
◦ Real-time priority class
◦ High priority class
◦ Above normal priority class
◦ Normal priority class
◦ Below normal priority class
◦ Low priority class
 Priorities in all classes except the real-time priority class
are variable
◦ This means that the priority of a thread in one of these
classes can change
https://prezi.com/2swi3wc7pger/xp-scheduling/
23
24
 Within each of the priority classes is a relative priority as
shown below
 The priority of each thread is based on the priority class
it belongs to and its relative priority within that class
https://prezi.com/2swi3wc7pger/xp-scheduling/
25
 The initial priority of a thread is typically the base priority
of the process that the thread belongs to
 When a thread’s time quantum runs out, that thread is
interrupted
 If the thread is in the variable-priority class, its priority is
lowered
◦ However, the priority is never lowered below the base
priority
 Lowering the thread’s priority tends to limit the CPU
consumption of compute-bound threads
26
 When a variable-priority thread is released from a wait
operation, the dispatcher boosts the priority
◦ The amount of boost depends on what the thread was
waiting for
 A thread that was waiting for keyboard I/O would get
a large increase
 A thread that was waiting for a disk operation would
get a moderate increase
 This strategy tends to give good response time to
interactive threads that are using the mouse and
windows
27
 It also enables I/O-bound threads to keep the
I/O devices busy while permitting compute-
bound threads to use spare CPU cycles in the
background
 This strategy is used by several time-sharing
operating systems, including UNIX
 In addition, the window with which the user is
currently interacting receives a priority boost to
enhance its response time
28
 When a user is running an interactive program, the
system needs to provide especially good performance
for that process
 Therefore, Windows XP has a special scheduling rule for
processes in the normal priority class
 Windows XP distinguishes between the foreground
process that is currently selected on the screen and the
background processes that are not currently selected
https://msdn.microsoft.com/en-
us/library/windows/desktop/ms685100(v=vs.85).aspx
29
 When a process moves in the foreground,
Windows XP increases the scheduling quantum
by some factor – typically by 3
 This increase gives the foreground process
three times longer to run before a time-sharing
pre-emption occurs
https://msdn.microsoft.com/en-
us/library/windows/desktop/ms685100(v=vs.85).aspx
30
 Earlier version of Windows provided a feature known as
Fiber.
 Fibers allowed several user-mode threads (fibers) to be
mapped to a single kernel thread.
 Fibers were of limited practical use.
 A fiber was unable to make calls to the windows API
 So Microsoft introduced a UMS.
http://superuser.com/questions/452780/scheduling-
algorithm-used-in-windows-7
31
 Windows 7 introduced a user-mode scheduling (UMS),
Which allows application to create and manage threads
independently of the kernel.
 Thus , an application can create and scheduled multiple
threads without involving the windows Kernel scheduler.
 Scheduling threads in user mode is much more efficient
than kernel mode.
http://superuser.com/questions/452780/scheduling-
algorithm-used-in-windows-7
32
CPU cycle-based thread scheduling
 The scheduler was modified to use the cycle counter
register of modern processors to keep track of exactly
how many CPU cycles a thread has executed, rather
than just using an interval-timer interrupt routine
 This new CPU cycle-based thread scheduling gives a
greater fairness and more deterministic app behavior.
http://en.wikipedia.org/wiki/Technical_features_new_to
_Windows_Vista#Kernel_and_core_OS_changes
33
WinJS Scheduling
 A new scheduler API in Windows 8.1 lets you set
the priority of tasks and manage jobs.
 This helps you write HTML5 apps that use system
resources more efficiently and provide a more
responsive experience to your users.
https://msdn.microsoft.com/en-
us/library/windows/apps/dn751496.aspx
34
 Pre-emptive scheduler with a flexible system of priority
levels that includes round-robin with multi level priority
queues.
 Dispatcher used a 32-level priority scheme to determine
the order of thread execution.
 The Windows Win32 API identifies six priority classes
 The priority of each thread is based on the priority class
it belongs to and its relative priority within that class.
 When a variable-priority thread is released from a wait
operation, the dispatcher boosts the priority.
 When a user is running an interactive program, the
system needs to provide especially good performance
for that process.
 Windows XP distinguishes between the foreground
process that is currently selected on the screen and the
background processes that are not currently selected.
35
 If processer are in idle state which type of thread are to
be executed ?
 Why Fibers are reject to serve as UMS ?
 When dispatcher boost the priority which type of thread
get a large increase ?
 For Which Processes are scheduling quantum by some
factor are increased by (eg75%) ?
 what is the latest Process Scheduling feature used in
windows 8.1 ? And how it’ll beneficial for programmers ?
 How many level priority scheme are used to determine ?
36
Lottery Scheduling
 Processes are each assigned some number of lottery
tickets.
 Scheduler draws a random ticket to select the next
process.
 The distribution of tickets need not be uniform.
 Granting a process more tickets provides it a relative
higher chance of selection.
 Lottery scheduling solves the problem of Starvation.
Giving each process at least one lottery ticket
guarantees that it has non-zero probability of being
selected at each scheduling operation.
http://en.wikipedia.org/wiki/Lottery_scheduling
37
http://www.allaboutpresentations.com/
2009/05/what-is-ideal-font-size-for.html
38

More Related Content

What's hot

SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
Shubham Singh
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
Abhijith Reloaded
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
ritu98
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani1
 
Multithreading
Multithreading Multithreading
Multithreading
WafaQKhan
 
Os Threads
Os ThreadsOs Threads
Os Threads
Salman Memon
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating SystemsNitish Gulati
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
Sanad Bhowmik
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
sgpraju
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
Christalin Nelson
 
CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher
ghayour abbas
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
sathish sak
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
Shanu Kumar
 
Inter process communication using Linux System Calls
Inter process communication using Linux System CallsInter process communication using Linux System Calls
Inter process communication using Linux System Callsjyoti9vssut
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
Raghav S
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Suvendu Kumar Dash
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
Nazir Ahmed
 

What's hot (20)

SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
operating system structure
operating system structureoperating system structure
operating system structure
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Multithreading
Multithreading Multithreading
Multithreading
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher CSI-503 - 13. Scheduler and Dispatcher
CSI-503 - 13. Scheduler and Dispatcher
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
CPU Scheduling algorithms
CPU Scheduling algorithmsCPU Scheduling algorithms
CPU Scheduling algorithms
 
Inter process communication using Linux System Calls
Inter process communication using Linux System CallsInter process communication using Linux System Calls
Inter process communication using Linux System Calls
 
Round robin scheduling
Round robin schedulingRound robin scheduling
Round robin scheduling
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 

Viewers also liked

The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
Peter Shirley-Quirk
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows VistaTrinh Phuc Tho
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
harini0810
 
Process management
Process managementProcess management
Process managementMohd Arif
 
Win8 architecture for developers
Win8 architecture for developersWin8 architecture for developers
Win8 architecture for developersRobert MacLean
 
4 ca-process structure
4 ca-process structure4 ca-process structure
4 ca-process structurekrissapat
 
Cryptography make easy
Cryptography make easyCryptography make easy
Cryptography make easy
Perfect Training Center
 
Advanced cryptography and implementation
Advanced cryptography and implementationAdvanced cryptography and implementation
Advanced cryptography and implementation
Akash Jadhav
 
Chrome dev tool
Chrome dev toolChrome dev tool
Chrome dev tool
Shih-En Chou
 
File system of windows xp
File system of windows xpFile system of windows xp
File system of windows xp
Ehtisham Ali
 
(07) instalaã§ã£o de programas
(07) instalaã§ã£o de programas(07) instalaã§ã£o de programas
(07) instalaã§ã£o de programasAnderson Lago
 
Loss Monitor
Loss MonitorLoss Monitor
Loss Monitor
Jean Pimentel
 
Process Scheduling
Process SchedulingProcess Scheduling
Chapter6 threads
Chapter6 threadsChapter6 threads
Chapter6 threads
Aditi Singh Chauhan
 
AIX - Gerência de Processos
AIX - Gerência de ProcessosAIX - Gerência de Processos
AIX - Gerência de Processos
Jean Pimentel
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
Shreya Kumar
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xpMohd Tousif
 
Linux O(1) Scheduling
Linux O(1) SchedulingLinux O(1) Scheduling
Linux O(1) Scheduling
Roy Lee
 

Viewers also liked (20)

The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Process management
Process managementProcess management
Process management
 
Os..
Os..Os..
Os..
 
Win8 architecture for developers
Win8 architecture for developersWin8 architecture for developers
Win8 architecture for developers
 
4 ca-process structure
4 ca-process structure4 ca-process structure
4 ca-process structure
 
Cryptography make easy
Cryptography make easyCryptography make easy
Cryptography make easy
 
Advanced cryptography and implementation
Advanced cryptography and implementationAdvanced cryptography and implementation
Advanced cryptography and implementation
 
Chrome dev tool
Chrome dev toolChrome dev tool
Chrome dev tool
 
File system of windows xp
File system of windows xpFile system of windows xp
File system of windows xp
 
(07) instalaã§ã£o de programas
(07) instalaã§ã£o de programas(07) instalaã§ã£o de programas
(07) instalaã§ã£o de programas
 
Loss Monitor
Loss MonitorLoss Monitor
Loss Monitor
 
Chapter03
Chapter03Chapter03
Chapter03
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Chapter6 threads
Chapter6 threadsChapter6 threads
Chapter6 threads
 
AIX - Gerência de Processos
AIX - Gerência de ProcessosAIX - Gerência de Processos
AIX - Gerência de Processos
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
System components of windows xp
System components of windows xpSystem components of windows xp
System components of windows xp
 
Linux O(1) Scheduling
Linux O(1) SchedulingLinux O(1) Scheduling
Linux O(1) Scheduling
 

Similar to Windows process-scheduling

Types of operating system
Types of operating systemTypes of operating system
Types of operating system
SyedfahadZakir
 
Insider operating system
Insider   operating systemInsider   operating system
Insider operating system
Aditi Saxena
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
RAMPRAKASHT1
 
Operating System / System Operasi
Operating System / System Operasi                   Operating System / System Operasi
Operating System / System Operasi
seolangit4
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
vtunotesbysree
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
nikhil287188
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
PrashantKhobragade3
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
AJAL A J
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTU
Agi George
 
4 Module - Operating Systems Configuration and Use by Mark John Lado
4 Module - Operating Systems Configuration and Use by Mark John Lado4 Module - Operating Systems Configuration and Use by Mark John Lado
4 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
Unit I OS CS.ppt
Unit I OS CS.pptUnit I OS CS.ppt
Unit I OS CS.ppt
Suganthi Vasanth Raj
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
jeetesh036
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
FahanaAbdulVahab
 
Introduction to Operating Systems - Mary Margarat
Introduction to Operating Systems - Mary MargaratIntroduction to Operating Systems - Mary Margarat
Introduction to Operating Systems - Mary Margarat
Mary Margarat
 
Operating System
Operating SystemOperating System
Operating System
MdFaraz20CAB121
 
OS_MD_1.pdf
OS_MD_1.pdfOS_MD_1.pdf
OS_MD_1.pdf
GauravDagar13
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
VAIBHAVSAHU55
 
Unit 1os processes and threads
Unit 1os processes and threadsUnit 1os processes and threads
Unit 1os processes and threads
donny101
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
Rashmi Bhat
 

Similar to Windows process-scheduling (20)

Types of operating system
Types of operating systemTypes of operating system
Types of operating system
 
Insider operating system
Insider   operating systemInsider   operating system
Insider operating system
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 
Operating System / System Operasi
Operating System / System Operasi                   Operating System / System Operasi
Operating System / System Operasi
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTU
 
4 Module - Operating Systems Configuration and Use by Mark John Lado
4 Module - Operating Systems Configuration and Use by Mark John Lado4 Module - Operating Systems Configuration and Use by Mark John Lado
4 Module - Operating Systems Configuration and Use by Mark John Lado
 
Unit I OS CS.ppt
Unit I OS CS.pptUnit I OS CS.ppt
Unit I OS CS.ppt
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Introduction to Operating Systems - Mary Margarat
Introduction to Operating Systems - Mary MargaratIntroduction to Operating Systems - Mary Margarat
Introduction to Operating Systems - Mary Margarat
 
Operating System
Operating SystemOperating System
Operating System
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
OS_MD_1.pdf
OS_MD_1.pdfOS_MD_1.pdf
OS_MD_1.pdf
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Unit 1os processes and threads
Unit 1os processes and threadsUnit 1os processes and threads
Unit 1os processes and threads
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 

Recently uploaded

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 

Recently uploaded (20)

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 

Windows process-scheduling

  • 1. 1
  • 2. 2
  • 3. ◦ Muhammed Talha MCS-13-08 ◦ Aitazaz Ahsan MCS-13-38 3
  • 4.  Scheduling  Scheduling Criteria  Windows Scheduling  Priority Schemes  Thread Priority  Scheduling Features in Windows 4
  • 5.  Maximum CPU utilization ? Multiprogramming. ◦ Several processes are kept in memory at one time. ◦ Any process can take over the CPU.  Process Scheduler is the component of the OS.  Scheduling of the CPU is fundamental to OS design. Ref: William Stalling 5
  • 6.  Assign processes to be executed by the processor over time.  Meets System objectives: ◦ Response time ◦ Throughput ◦ Processor efficiency Ref: William Stalling 6
  • 7.  Scheduling function should: ◦ Share time fairly among processes ◦ Prevent starvation of a process ◦ Use the processor efficiently ◦ Have low overhead ◦ Prioritise processes when necessary Ref: William Stalling 7
  • 8.  CPU scheduling is affected by the following : ◦ (N) A process switches from running to waiting state ◦ (P) A process switches from running to ready state ◦ (P) A process switches from waiting to ready state ◦ (N) A process switches from running to terminate state  Circumstances 1 and 4 are non pre-emptive; “they offer no schedule choice”  Circumstances 2 and 3 are pre-emptive; “they can be scheduled” Ref: William Stalling 8
  • 10.  The dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: ◦ switching context ◦ switching to user mode  The dispatcher needs to run as fast as possible, since it is invoked during process context switch.  The time it takes for the dispatcher to stop one process and start another process is called dispatch latency. http://en.wikipedia.org/wiki/Scheduling_(computing) 10
  • 11.  Different CPU scheduling algorithms have different properties.  The choice of a particular algorithm may favour one class of processes over another.  In choosing which algorithm to use, the properties of the various algorithms should be considered. Ref: William Stalling 11
  • 12.  Criteria for comparing CPU scheduling algorithms may include: ◦ CPU utilization ◦ Throughput ◦ Turnaround time ◦ Response time ◦ Waiting time Ref: William Stalling 12
  • 13.  First Come, First Served (FCFS)  Shortest Job First (SJF)  Priority  Round Robin (RR) Ref: William Stalling 13
  • 14.  DOS-Based ◦ Windows 3.1x  Windows 9x ◦ Windows 95, 98, ME  Windows NT ◦ 2000, XP, Vista, 7, 8, 10  Windows Server ◦ 2003, 2008, 2012  Windows Mobile  Windows Phone ◦ 7, 8, 10 http://en.wikipedia.org/wiki/Windows_NT 14
  • 15.  MS-DOS is non-multitasking, and as such did not feature a schedule.  Windows 3.1x used a non-preemptive scheduler, meaning that it did not interrupt programs.  Windows 95 introduced a rudimentary preemptive scheduler. http://en.wikipedia.org/wiki/Scheduling_(computing) 15
  • 16.  Windows NT-based operating systems use a multilevel feedback queue. 32 priority levels are defined, ◦ Give preference to short jobs. ◦ Give preference to I/O bound processes. ◦ Quickly establish the nature of a process and schedule the process accordingly. All processes receive a priority boost after a wait event, but processes that have experienced a keyboard I/O wait get a larger boost than those that have experienced a disk I/O wait. http://www.ukessays.com/essays/information- systems/compare-cpu-scheduling-of-linux-and- windows.php 16
  • 17.  Windows XP schedules threads using a priority-based, pre-emptive scheduler with a flexible system of priority levels that includes round-robin scheduling within each level.  The scheduler ensures that the highest priority thread will always run.  The portion of the Windows kernel that handles scheduling is called the dispatcher. http://en.wikipedia.org/wiki/Scheduling_(computing) 17
  • 18.  A thread selected to run by the dispatcher will run until it: ◦ Pre-empted by a higher-priority thread, ◦ Terminates, ◦ Time quantum ends, ◦ Calls a blocking system call such as I/O  If a higher priority real-time thread becomes ready while a lower-priority thread is running, lower-priority thread will be pre-empted. ◦ This pre-emption gives a real-time thread preferential access to the CPU when the thread needs such access. http://en.wikipedia.org/wiki/Scheduling_(computing) 18
  • 20.  The dispatcher uses a 32-level priority scheme to determine the order of thread execution  Priorities are divided into two classes ◦ The variable class contains threads having priorities 1 to 15 ◦ The real-time class contains threads with priorities ranging from 16 to 31 ◦ There is also a thread running at priority 0 that is used for memory management Ref: William Stalling 20
  • 21.  The dispatcher uses a queue for each scheduling priority and traverses the set of queues from highest to lowest until it finds a thread that is ready to run  If no ready thread is found, the dispatcher will execute a special thread called the idle thread Ref: William Stalling 21
  • 23.  The Windows Win32 API identifies six priority classes to which a process can belong as shown below ◦ Real-time priority class ◦ High priority class ◦ Above normal priority class ◦ Normal priority class ◦ Below normal priority class ◦ Low priority class  Priorities in all classes except the real-time priority class are variable ◦ This means that the priority of a thread in one of these classes can change https://prezi.com/2swi3wc7pger/xp-scheduling/ 23
  • 24. 24
  • 25.  Within each of the priority classes is a relative priority as shown below  The priority of each thread is based on the priority class it belongs to and its relative priority within that class https://prezi.com/2swi3wc7pger/xp-scheduling/ 25
  • 26.  The initial priority of a thread is typically the base priority of the process that the thread belongs to  When a thread’s time quantum runs out, that thread is interrupted  If the thread is in the variable-priority class, its priority is lowered ◦ However, the priority is never lowered below the base priority  Lowering the thread’s priority tends to limit the CPU consumption of compute-bound threads 26
  • 27.  When a variable-priority thread is released from a wait operation, the dispatcher boosts the priority ◦ The amount of boost depends on what the thread was waiting for  A thread that was waiting for keyboard I/O would get a large increase  A thread that was waiting for a disk operation would get a moderate increase  This strategy tends to give good response time to interactive threads that are using the mouse and windows 27
  • 28.  It also enables I/O-bound threads to keep the I/O devices busy while permitting compute- bound threads to use spare CPU cycles in the background  This strategy is used by several time-sharing operating systems, including UNIX  In addition, the window with which the user is currently interacting receives a priority boost to enhance its response time 28
  • 29.  When a user is running an interactive program, the system needs to provide especially good performance for that process  Therefore, Windows XP has a special scheduling rule for processes in the normal priority class  Windows XP distinguishes between the foreground process that is currently selected on the screen and the background processes that are not currently selected https://msdn.microsoft.com/en- us/library/windows/desktop/ms685100(v=vs.85).aspx 29
  • 30.  When a process moves in the foreground, Windows XP increases the scheduling quantum by some factor – typically by 3  This increase gives the foreground process three times longer to run before a time-sharing pre-emption occurs https://msdn.microsoft.com/en- us/library/windows/desktop/ms685100(v=vs.85).aspx 30
  • 31.  Earlier version of Windows provided a feature known as Fiber.  Fibers allowed several user-mode threads (fibers) to be mapped to a single kernel thread.  Fibers were of limited practical use.  A fiber was unable to make calls to the windows API  So Microsoft introduced a UMS. http://superuser.com/questions/452780/scheduling- algorithm-used-in-windows-7 31
  • 32.  Windows 7 introduced a user-mode scheduling (UMS), Which allows application to create and manage threads independently of the kernel.  Thus , an application can create and scheduled multiple threads without involving the windows Kernel scheduler.  Scheduling threads in user mode is much more efficient than kernel mode. http://superuser.com/questions/452780/scheduling- algorithm-used-in-windows-7 32
  • 33. CPU cycle-based thread scheduling  The scheduler was modified to use the cycle counter register of modern processors to keep track of exactly how many CPU cycles a thread has executed, rather than just using an interval-timer interrupt routine  This new CPU cycle-based thread scheduling gives a greater fairness and more deterministic app behavior. http://en.wikipedia.org/wiki/Technical_features_new_to _Windows_Vista#Kernel_and_core_OS_changes 33
  • 34. WinJS Scheduling  A new scheduler API in Windows 8.1 lets you set the priority of tasks and manage jobs.  This helps you write HTML5 apps that use system resources more efficiently and provide a more responsive experience to your users. https://msdn.microsoft.com/en- us/library/windows/apps/dn751496.aspx 34
  • 35.  Pre-emptive scheduler with a flexible system of priority levels that includes round-robin with multi level priority queues.  Dispatcher used a 32-level priority scheme to determine the order of thread execution.  The Windows Win32 API identifies six priority classes  The priority of each thread is based on the priority class it belongs to and its relative priority within that class.  When a variable-priority thread is released from a wait operation, the dispatcher boosts the priority.  When a user is running an interactive program, the system needs to provide especially good performance for that process.  Windows XP distinguishes between the foreground process that is currently selected on the screen and the background processes that are not currently selected. 35
  • 36.  If processer are in idle state which type of thread are to be executed ?  Why Fibers are reject to serve as UMS ?  When dispatcher boost the priority which type of thread get a large increase ?  For Which Processes are scheduling quantum by some factor are increased by (eg75%) ?  what is the latest Process Scheduling feature used in windows 8.1 ? And how it’ll beneficial for programmers ?  How many level priority scheme are used to determine ? 36
  • 37. Lottery Scheduling  Processes are each assigned some number of lottery tickets.  Scheduler draws a random ticket to select the next process.  The distribution of tickets need not be uniform.  Granting a process more tickets provides it a relative higher chance of selection.  Lottery scheduling solves the problem of Starvation. Giving each process at least one lottery ticket guarantees that it has non-zero probability of being selected at each scheduling operation. http://en.wikipedia.org/wiki/Lottery_scheduling 37