SlideShare a Scribd company logo
Sherif Hammad
Real Time Operating System
Idle Task
2
Agenda
• Idle Task Call Back
• Changing Tasks priorities
• Scheduling Wrap up
3
The Idle Task and the Idle Task Hook
(Idle Task CallBack)
• An Idle task is automatically created by the scheduler when
vTaskStartScheduler() is called.
• The idle task does very little more than sit in a loop
• The idle task has the lowest possible priority (priority zero), to
ensure it never prevents a higher priority application task from
entering the Running state
• Idle task is always pre-empted by higher priority tasks
• idle hook (or idle callback) function—a function that is called
automatically by the idle task once per iteration of the idle task
loop
• Common uses for the Idle task hook include:
o Executing low priority, background, or continuous processing.
o Measuring the amount of spare processing capacity.
o Placing the processor into a low power mode
• configUSE_IDLE_HOOK must be set to 1 within FreeRTOSConfig.h
for the idle hook function to get called.
4
Example 7: Idle Task CallBack
5
Example 7: Idle Task CallBack
How many times IdelTask is called between tasks calls?
6
Changing task priorities; Example 8
7
Changing task priorities; Example 8
8
Changing task priorities; Example 8
9
Changing task priorities; Example 8
10
The Scheduling Algorithm—A Summary
• Fixed Prioritized Pre-emptive Scheduling
o Each task is assigned a priority.
o Each task can exist in one of several states.
o Only one task can exist in the Running state at any one time.
o The scheduler always selects the highest priority Ready state task to enter
the Running state.
• Fixed Priority’ because each task is assigned a priority that is not
altered by the kernel itself (only tasks can change priorities);
• ‘Pre-emptive’ because a task entering the Ready state or having its
priority altered will always pre-empt the Running state task, if the
Running state task has a lower priority.
11
The Scheduling Algorithm—A Summary

More Related Content

PDF
FreeRTOS Slides annotations.pdf
PPTX
FreeRTOS basics (Real time Operating System)
PDF
AOS Lab 6: Scheduling
PPTX
Process scheduling in Light weight weight and Heavy weight processes.
PPTX
PDF
operating system (1).pdf
PPTX
synchronization in operating system structure
PPTX
Thread-Preemption-and-Preemptive-Task-Scheduling.pptx(3).pptx
FreeRTOS Slides annotations.pdf
FreeRTOS basics (Real time Operating System)
AOS Lab 6: Scheduling
Process scheduling in Light weight weight and Heavy weight processes.
operating system (1).pdf
synchronization in operating system structure
Thread-Preemption-and-Preemptive-Task-Scheduling.pptx(3).pptx

Similar to 3_FreeRTOS_Kernel_Priorities_Part3.pdf (20)

PPTX
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
PPTX
Process scheduling
PPTX
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
PPTX
CPU Scheduling Algorithms
PPTX
MODULE 3 process synchronizationnnn.pptx
PPTX
L6 CPU Scheduling.pptx
PPTX
Real Time Kernels
PPTX
Lecture 4 process cpu scheduling
PPTX
Preempt_rt realtime patch
PPT
scheduling Uni processor Long-term .ppt
PDF
Jolt: Distributed, fault-tolerant test running at scale using Mesos
PDF
[Altibase] 10 replication part3 (system design)
PPTX
CNT_Lecture 8.pptx operating system computer
PPTX
Round Robin Algorithm.pptx
PPTX
Synchronization problem with threads
PPTX
Lecture 7 cpu scheduling
PPTX
How Workload Prioritization Reduces Your Datacenter Footprint
PPT
Chapter No 4 CPU Scheduling and Algorithms.ppt
PPT
CA 7-final-ppt
PDF
Linux Preempt-RT Internals
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Process scheduling
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Algorithms
MODULE 3 process synchronizationnnn.pptx
L6 CPU Scheduling.pptx
Real Time Kernels
Lecture 4 process cpu scheduling
Preempt_rt realtime patch
scheduling Uni processor Long-term .ppt
Jolt: Distributed, fault-tolerant test running at scale using Mesos
[Altibase] 10 replication part3 (system design)
CNT_Lecture 8.pptx operating system computer
Round Robin Algorithm.pptx
Synchronization problem with threads
Lecture 7 cpu scheduling
How Workload Prioritization Reduces Your Datacenter Footprint
Chapter No 4 CPU Scheduling and Algorithms.ppt
CA 7-final-ppt
Linux Preempt-RT Internals

Recently uploaded (20)

PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PPT
Occupational Health and Safety Management System
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
Software Engineering and software moduleing
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
Design Guidelines and solutions for Plastics parts
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
Soil Improvement Techniques Note - Rabbi
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Management Information system : MIS-e-Business Systems.pptx
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Occupational Health and Safety Management System
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Visual Aids for Exploratory Data Analysis.pdf
III.4.1.2_The_Space_Environment.p pdffdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Automation-in-Manufacturing-Chapter-Introduction.pdf
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Software Engineering and software moduleing
distributed database system" (DDBS) is often used to refer to both the distri...
Design Guidelines and solutions for Plastics parts

3_FreeRTOS_Kernel_Priorities_Part3.pdf

  • 1. Sherif Hammad Real Time Operating System Idle Task
  • 2. 2 Agenda • Idle Task Call Back • Changing Tasks priorities • Scheduling Wrap up
  • 3. 3 The Idle Task and the Idle Task Hook (Idle Task CallBack) • An Idle task is automatically created by the scheduler when vTaskStartScheduler() is called. • The idle task does very little more than sit in a loop • The idle task has the lowest possible priority (priority zero), to ensure it never prevents a higher priority application task from entering the Running state • Idle task is always pre-empted by higher priority tasks • idle hook (or idle callback) function—a function that is called automatically by the idle task once per iteration of the idle task loop • Common uses for the Idle task hook include: o Executing low priority, background, or continuous processing. o Measuring the amount of spare processing capacity. o Placing the processor into a low power mode • configUSE_IDLE_HOOK must be set to 1 within FreeRTOSConfig.h for the idle hook function to get called.
  • 4. 4 Example 7: Idle Task CallBack
  • 5. 5 Example 7: Idle Task CallBack How many times IdelTask is called between tasks calls?
  • 10. 10 The Scheduling Algorithm—A Summary • Fixed Prioritized Pre-emptive Scheduling o Each task is assigned a priority. o Each task can exist in one of several states. o Only one task can exist in the Running state at any one time. o The scheduler always selects the highest priority Ready state task to enter the Running state. • Fixed Priority’ because each task is assigned a priority that is not altered by the kernel itself (only tasks can change priorities); • ‘Pre-emptive’ because a task entering the Ready state or having its priority altered will always pre-empt the Running state task, if the Running state task has a lower priority.