SlideShare una empresa de Scribd logo
1 de 17
Silberschatz, Galvin and Gagne 2002
1.1
CPU Scheduling
Basic Concepts
• Maximum CPU utilization obtained with multiprogramming.
• In a uniprocessor system, only one process may run a time, any other process
must wait until the CPU is free and can be rescheduled.
CPU-I/O Burst Cycle
• CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU
execution and I/O wait. Process alternate between these two states.
• Process execution begins with a CPU burst. That is followed by an I/O burst,
then another CPU burst, then another I/O burst, and so on.
• Eventually, the last CPU burst will end with a system request to terminate
execution, rather than with another I/O burst.
Silberschatz, Galvin and Gagne 2002
1.2
• An I/O bound program would typically have many very short CPU bursts.
• A CPU-bound program might have a few very long CPU bursts.
• This distribution can help us to select an appropriate CPU-scheduling algorithm.
Alternating Sequence of CPU And I/O Bursts
Silberschatz, Galvin and Gagne 2002
1.3
CPU Scheduler
 Whenever the CPU becomes idle, the operating system must select
one of the processes in the ready queue to be executed.
 The selection process is carried out by the short-term scheduler (CPU
scheduler).
 The scheduler selects from among the processes in memory that are
ready to execute, and allocates the CPU to one of them.
 CPU scheduling decisions may take place when a process:
1. Switches from running to waiting state.
2. Switches from running to ready state.
3. Switches from waiting to ready.
4. Terminates.
Silberschatz, Galvin and Gagne 2002
1.4
Preemptive Scheduling
CPU scheduling decisions may take place under the following four circumstances:
1. When a process switches from the running state to the waiting state (for
example, I/O request, or invocation of wait for the termination of one of the
child processes)
2. When a process switches from the running state to the ready state ( for
example, when an interrupt occurs)
3. When a process switches from the waiting state to the ready state (for
example, completion of I/O)
4. When a process termination
In circumstances 1 and 4, there is no choice in terms of scheduling. A new process
(if one exists in the ready queue) must be selected for execution. There is a
choice, however, in circumstances 2 and 3.
When scheduling takes place only under circumstances 1 and 4, the scheduling
scheme is called nonpreemptive; otherwise, the scheduling scheme is
preemptive.
Silberschatz, Galvin and Gagne 2002
1.5
Dispatcher
 Dispatcher module gives control of the CPU to the process selected
by the short-term scheduler; this involves:
 switching context
 switching to user mode
 jumping to the proper location in the user program to restart that program
 Dispatch latency – time it takes for the dispatcher to stop one process
and start another running.
Silberschatz, Galvin and Gagne 2002
1.6
Scheduling Criteria
 CPU utilization – keep the CPU as busy as possible.
 Throughput – No. of processes that complete their execution per time
unit.
 Turnaround time – amount of time to execute a particular process.
 Waiting time – amount of time a process has been waiting in the ready
queue.
 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)
• Different CPU scheduling algorithms have different properties.
• In choosing which algorithm to use, the properties of the various algorithms should
be considered.
Criteria for comparing CPU scheduling algorithms may include the following.
Silberschatz, Galvin and Gagne 2002
1.7
CPU Scheduling Algorithms
1. FCFS
2. SJF
3. Priority scheduling
4. Round Robin scheduling
Operating System Concepts
Silberschatz, Galvin and Gagne 2002
1.8
SO 2 : Explain the procedures in First-Come First-
Served (FCFS) Scheduling
Process Burst Time
P1 24
P2 3
P3 3
 Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
 Waiting time for P1 = 0; P2 = 24; P3 = 27
 Average waiting time: (0 + 24 + 27)/3 = 17
P1 P2 P3
24 27 30
0
Silberschatz, Galvin and Gagne 2002
1.9
FCFS Scheduling (Cont.)
Suppose that the processes arrive in the order
P2 , P3 , P1 .
 The Gantt chart for the schedule is:
 Waiting time for P1 = 6; P2 = 0; P3 = 3
 Average waiting time: (6 + 0 + 3)/3 = 3
 Much better than previous case.
 Convoy effect short process behind long process
P1
P3
P2
6
3 30
0
Silberschatz, Galvin and Gagne 2002
1.10
SO 3: Demonstrate Shortest-Job-First (SJR)
Scheduling and Priority scheduling
 Associate with each process the length of its next CPU
burst. Use these lengths to schedule the process with the
shortest time.
 Two schemes:
 nonpreemptive – once CPU given to the process it cannot
be preempted until completes its CPU burst.
 preemptive – if a new process arrives with CPU burst length
less than remaining time of current executing process,
preempt. This scheme is know as the
Shortest-Remaining-Time-First (SRTF).
 SJF is optimal – gives minimum average waiting time for
a given set of processes.
Silberschatz, Galvin and Gagne 2002
1.11
Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
 SJF (non-preemptive)
 Average waiting time = (0 + 6 + 3 + 7)/4 - 4
Example of Non-Preemptive SJF
P1 P3 P2
7
3 16
0
P4
8 12
Silberschatz, Galvin and Gagne 2002
1.12
Example of Preemptive SJF
Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
 SJF (preemptive)
 Average waiting time = (9 + 1 + 0 +2)/4 - 3
P1 P3
P2
4
2 11
0
P4
5 7
P2 P1
16
Silberschatz, Galvin and Gagne 2002
1.13
Priority Scheduling
 A priority number (integer) is associated with each
process
 The CPU is allocated to the process with the highest
priority (smallest integer  highest priority).
 Preemptive
 nonpreemptive
 SJF is a priority scheduling where priority is the predicted
next CPU burst time.
 Problem  Starvation – low priority processes may never
execute.
 Solution  Aging – as time progresses increase the
priority of the process.
Silberschatz, Galvin and Gagne 2002
1.14
SO 4 : Determine the AWT and ATT using
Round Robin (RR) scheduling
 Each process gets a small unit of CPU time (time
quantum), usually 10-100 milliseconds. After this time
has elapsed, the process is preempted and added to the
end of the ready queue.
 If there are n processes in the ready queue and the time
quantum is q, then each process gets 1/n of the CPU time
in chunks of at most q time units at once. No process
waits more than (n-1)q time units.
 Performance
 q large  FIFO
 q small  q must be large with respect to context switch,
otherwise overhead is too high.
Silberschatz, Galvin and Gagne 2002
1.15
Example of RR with Time Quantum = 20
Process Burst Time
P1 53
P2 17
P3 68
P4 24
 The Gantt chart is:
 Typically, higher average turnaround than SJF, but better
response.
P1 P2 P3 P4 P1 P3 P4 P1 P3 P3
0 20 37 57 77 97 117 121 134 154 162
Silberschatz, Galvin and Gagne 2002
1.16
Multiprocessor Scheduling
 Multiple processor scheduling or multiprocessor
scheduling focuses on designing the system's scheduling
function, which consists of more than one processor.
 Multiple CPUs share the load (load sharing) in multiprocessor
scheduling so that various processes run simultaneously
 In general, multiprocessor scheduling is complex as compared
to single processor scheduling
 In the multiprocessor scheduling, there are many processors,
and they are identical, and we can run any process at any time
 The multiple CPUs in the system are in close communication,
which shares a common bus, memory, and other peripheral
devices. So we can say that the system is tightly coupled.
 These systems are used when we want to process a bulk
amount of data, and these systems are mainly used in satellite,
weather forecasting, etc
Silberschatz, Galvin and Gagne 2002
1.17
Multiprocessor Scheduling
 Multiprocessor systems may e heterogeneous (different
kinds of CPUs) or homogenous (the same CPU). There
may be special scheduling constraints, such as devices
connected via a private bus to only one CPU
 There is no policy or rule which can be declared as the best
scheduling solution to a system with a single processor.
Similarly, there is no best scheduling solution for a system with
multiple processors as well

Más contenido relacionado

Similar a U2-LP2.ppt

Similar a U2-LP2.ppt (20)

ch5_EN_CPUSched_2022.pdf
ch5_EN_CPUSched_2022.pdfch5_EN_CPUSched_2022.pdf
ch5_EN_CPUSched_2022.pdf
 
Operating System Scheduling
Operating System SchedulingOperating System Scheduling
Operating System Scheduling
 
cpu scheduling
cpu schedulingcpu scheduling
cpu scheduling
 
Module3 CPU Scheduling.ppt
Module3 CPU Scheduling.pptModule3 CPU Scheduling.ppt
Module3 CPU Scheduling.ppt
 
Cpu scheduling pre final formatting
Cpu scheduling pre final formattingCpu scheduling pre final formatting
Cpu scheduling pre final formatting
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Cpu scheduling final
Cpu scheduling finalCpu scheduling final
Cpu scheduling final
 
6 cpu scheduling
6 cpu scheduling6 cpu scheduling
6 cpu scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
OS_Ch05.pdf
OS_Ch05.pdfOS_Ch05.pdf
OS_Ch05.pdf
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
Preemptive process example.pptx
Preemptive process example.pptxPreemptive process example.pptx
Preemptive process example.pptx
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Ch6 CPU Scheduling galvin
Ch6 CPU Scheduling galvinCh6 CPU Scheduling galvin
Ch6 CPU Scheduling galvin
 
Ch6: CPU Scheduling
Ch6: CPU SchedulingCh6: CPU Scheduling
Ch6: CPU Scheduling
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
OSCh6
OSCh6OSCh6
OSCh6
 
Ch5
Ch5Ch5
Ch5
 
CPU scheduling ppt file
CPU scheduling ppt fileCPU scheduling ppt file
CPU scheduling ppt file
 
ch5_EN_CPUSched.pdf
ch5_EN_CPUSched.pdfch5_EN_CPUSched.pdf
ch5_EN_CPUSched.pdf
 

Más de AJAYVISHALRP (10)

finalppt-150606051347-lva1-app6892.pptx
finalppt-150606051347-lva1-app6892.pptxfinalppt-150606051347-lva1-app6892.pptx
finalppt-150606051347-lva1-app6892.pptx
 
WH PAPER PRESENTATION PPT.pptx
WH PAPER PRESENTATION PPT.pptxWH PAPER PRESENTATION PPT.pptx
WH PAPER PRESENTATION PPT.pptx
 
Data Storage Access and Security.pptx
Data Storage Access and Security.pptxData Storage Access and Security.pptx
Data Storage Access and Security.pptx
 
U3-PPT-1 (1).ppt
U3-PPT-1 (1).pptU3-PPT-1 (1).ppt
U3-PPT-1 (1).ppt
 
U1-LP1.ppt
U1-LP1.pptU1-LP1.ppt
U1-LP1.ppt
 
disk scheduling algorithms.pptx
disk scheduling algorithms.pptxdisk scheduling algorithms.pptx
disk scheduling algorithms.pptx
 
1G1.pptx
1G1.pptx1G1.pptx
1G1.pptx
 
WH PAPER PRESENTATION PPT.pptx
WH PAPER PRESENTATION PPT.pptxWH PAPER PRESENTATION PPT.pptx
WH PAPER PRESENTATION PPT.pptx
 
sorting1.pptx
sorting1.pptxsorting1.pptx
sorting1.pptx
 
AI Pugal.pptx
AI Pugal.pptxAI Pugal.pptx
AI Pugal.pptx
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

U2-LP2.ppt

  • 1. Silberschatz, Galvin and Gagne 2002 1.1 CPU Scheduling Basic Concepts • Maximum CPU utilization obtained with multiprogramming. • In a uniprocessor system, only one process may run a time, any other process must wait until the CPU is free and can be rescheduled. CPU-I/O Burst Cycle • CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait. Process alternate between these two states. • Process execution begins with a CPU burst. That is followed by an I/O burst, then another CPU burst, then another I/O burst, and so on. • Eventually, the last CPU burst will end with a system request to terminate execution, rather than with another I/O burst.
  • 2. Silberschatz, Galvin and Gagne 2002 1.2 • An I/O bound program would typically have many very short CPU bursts. • A CPU-bound program might have a few very long CPU bursts. • This distribution can help us to select an appropriate CPU-scheduling algorithm. Alternating Sequence of CPU And I/O Bursts
  • 3. Silberschatz, Galvin and Gagne 2002 1.3 CPU Scheduler  Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed.  The selection process is carried out by the short-term scheduler (CPU scheduler).  The scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.  CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state. 2. Switches from running to ready state. 3. Switches from waiting to ready. 4. Terminates.
  • 4. Silberschatz, Galvin and Gagne 2002 1.4 Preemptive Scheduling CPU scheduling decisions may take place under the following four circumstances: 1. When a process switches from the running state to the waiting state (for example, I/O request, or invocation of wait for the termination of one of the child processes) 2. When a process switches from the running state to the ready state ( for example, when an interrupt occurs) 3. When a process switches from the waiting state to the ready state (for example, completion of I/O) 4. When a process termination In circumstances 1 and 4, there is no choice in terms of scheduling. A new process (if one exists in the ready queue) must be selected for execution. There is a choice, however, in circumstances 2 and 3. When scheduling takes place only under circumstances 1 and 4, the scheduling scheme is called nonpreemptive; otherwise, the scheduling scheme is preemptive.
  • 5. Silberschatz, Galvin and Gagne 2002 1.5 Dispatcher  Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves:  switching context  switching to user mode  jumping to the proper location in the user program to restart that program  Dispatch latency – time it takes for the dispatcher to stop one process and start another running.
  • 6. Silberschatz, Galvin and Gagne 2002 1.6 Scheduling Criteria  CPU utilization – keep the CPU as busy as possible.  Throughput – No. of processes that complete their execution per time unit.  Turnaround time – amount of time to execute a particular process.  Waiting time – amount of time a process has been waiting in the ready queue.  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) • Different CPU scheduling algorithms have different properties. • In choosing which algorithm to use, the properties of the various algorithms should be considered. Criteria for comparing CPU scheduling algorithms may include the following.
  • 7. Silberschatz, Galvin and Gagne 2002 1.7 CPU Scheduling Algorithms 1. FCFS 2. SJF 3. Priority scheduling 4. Round Robin scheduling Operating System Concepts
  • 8. Silberschatz, Galvin and Gagne 2002 1.8 SO 2 : Explain the procedures in First-Come First- Served (FCFS) Scheduling Process Burst Time P1 24 P2 3 P3 3  Suppose that the processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is:  Waiting time for P1 = 0; P2 = 24; P3 = 27  Average waiting time: (0 + 24 + 27)/3 = 17 P1 P2 P3 24 27 30 0
  • 9. Silberschatz, Galvin and Gagne 2002 1.9 FCFS Scheduling (Cont.) Suppose that the processes arrive in the order P2 , P3 , P1 .  The Gantt chart for the schedule is:  Waiting time for P1 = 6; P2 = 0; P3 = 3  Average waiting time: (6 + 0 + 3)/3 = 3  Much better than previous case.  Convoy effect short process behind long process P1 P3 P2 6 3 30 0
  • 10. Silberschatz, Galvin and Gagne 2002 1.10 SO 3: Demonstrate Shortest-Job-First (SJR) Scheduling and Priority scheduling  Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time.  Two schemes:  nonpreemptive – once CPU given to the process it cannot be preempted until completes its CPU burst.  preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF).  SJF is optimal – gives minimum average waiting time for a given set of processes.
  • 11. Silberschatz, Galvin and Gagne 2002 1.11 Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4  SJF (non-preemptive)  Average waiting time = (0 + 6 + 3 + 7)/4 - 4 Example of Non-Preemptive SJF P1 P3 P2 7 3 16 0 P4 8 12
  • 12. Silberschatz, Galvin and Gagne 2002 1.12 Example of Preemptive SJF Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4  SJF (preemptive)  Average waiting time = (9 + 1 + 0 +2)/4 - 3 P1 P3 P2 4 2 11 0 P4 5 7 P2 P1 16
  • 13. Silberschatz, Galvin and Gagne 2002 1.13 Priority Scheduling  A priority number (integer) is associated with each process  The CPU is allocated to the process with the highest priority (smallest integer  highest priority).  Preemptive  nonpreemptive  SJF is a priority scheduling where priority is the predicted next CPU burst time.  Problem  Starvation – low priority processes may never execute.  Solution  Aging – as time progresses increase the priority of the process.
  • 14. Silberschatz, Galvin and Gagne 2002 1.14 SO 4 : Determine the AWT and ATT using Round Robin (RR) scheduling  Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.  If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units.  Performance  q large  FIFO  q small  q must be large with respect to context switch, otherwise overhead is too high.
  • 15. Silberschatz, Galvin and Gagne 2002 1.15 Example of RR with Time Quantum = 20 Process Burst Time P1 53 P2 17 P3 68 P4 24  The Gantt chart is:  Typically, higher average turnaround than SJF, but better response. P1 P2 P3 P4 P1 P3 P4 P1 P3 P3 0 20 37 57 77 97 117 121 134 154 162
  • 16. Silberschatz, Galvin and Gagne 2002 1.16 Multiprocessor Scheduling  Multiple processor scheduling or multiprocessor scheduling focuses on designing the system's scheduling function, which consists of more than one processor.  Multiple CPUs share the load (load sharing) in multiprocessor scheduling so that various processes run simultaneously  In general, multiprocessor scheduling is complex as compared to single processor scheduling  In the multiprocessor scheduling, there are many processors, and they are identical, and we can run any process at any time  The multiple CPUs in the system are in close communication, which shares a common bus, memory, and other peripheral devices. So we can say that the system is tightly coupled.  These systems are used when we want to process a bulk amount of data, and these systems are mainly used in satellite, weather forecasting, etc
  • 17. Silberschatz, Galvin and Gagne 2002 1.17 Multiprocessor Scheduling  Multiprocessor systems may e heterogeneous (different kinds of CPUs) or homogenous (the same CPU). There may be special scheduling constraints, such as devices connected via a private bus to only one CPU  There is no policy or rule which can be declared as the best scheduling solution to a system with a single processor. Similarly, there is no best scheduling solution for a system with multiple processors as well