Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Task with the same level

Posted by ulmus on October 9, 2011
I cannot find it with clear explanation: e.g. i have many tasks with the same level/priority then.... are they started one by one every tick and after the last there is started first task and so on? What if one task longs longer then one or more tick period? Is there then task switch?

RE: Task with the same level

Posted by MEdwards on October 9, 2011
Tasks that have the same priority and are in the ready state will run in turn, with a task switch on each tick interrupt (or task yield), but are not guaranteed to get the same amount of running time. For example, interrupts might take up some time.

RE: Task with the same level

Posted by Richard Damon on October 9, 2011
Basically what FreeRTOS does (when configured for preemption, and the schedule is not currently suspended) is on the Tick Interrupt, the current task Yields, which suspends the current task, and moves it to the end of it ready queue. It then schedules the task at the front of the highest ready queue with an available task. This will generally cause the tasks of a given priority to run is sequence. Ad Edwards says, this doesn't mean they will all get equal time, not only due to interrupts, but if higher priority tasks unblock, they will take time from the current task. At a pathological extreme, one of the tasks could be checking the timer tick and just before the tick comes could start a higher priority task (that runs long enough to go past the timer tick), and I believe it will restart when the higher priority task finishes, perhaps starving other tasks at its level, or it could yield just before the timer tick, causing the next task in sequence to get short changed for it share of the tick. This is one reason while the idle task can be configured to yield or not. If it yields and there are two other tasks that share its priority, the one following the idle task will get short changed for time, while if it doesn't yield, they all will be given full slots, but you are losing some available time.

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists