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




Loading

FreeRTOS and priority inversion

Posted by Thomas K.-H. Nittel on July 19, 2006
Hi,

are ressource semaphors with priority inheritance planned to be realized to avoid priority inversion of tasks?
Thanks in advance.

Regards

Thomas

RE: FreeRTOS and priority inversion

Posted by Richard on July 19, 2006
Hi again,

This is a subject that causes a lot of debate!

Including a priority inversion mechanism is straight forward. I think there may be an example knocking about somewhere.

Basically the semaphore requires an extra member that contains the priority of the task that currently holds the semaphore, as follows:

+ TaskA is priority 1, TaskB priority 2.
+ TaskA taskes the semaphore, its priority is stored in the semaphore.
+ TaskB attempts to get the semaphore. It has a higher priority, so the priority of TaskA is raised to that of TaskB.
+ TaskA releases the semaphore, and as it does so has its priority reset back to that stored in the semaphore.

So you may say, if that is all there is to it, why not implement it, which is where people normally start to disagree with me ;-)

IMHO FreeRTOS.org is designed to work with small embedded systems. As such priority inversion should be taken into account at the application design level. In other words, don't design your application so that priority inversion can occur in the first place. Even with the inversion mechanism in place a higher priority task can be delayed by a lower priority task, albeit for less time than if the inversion prevention mechanism was not in place.

If you were designing a large system where resource management across multiple developers was a trickier problem, then a safeguard within the RTOS itself would be more appropriate. As it is I prefer not to introduce the extra RAM and runtime overhead.

This could be introduced as a compile time option. The original intent was to limit the number of compile time options within the code to aid readability, but this seems to be going out the window somewhat anyway.

Flame away!

Regards.

RE: FreeRTOS and priority inversion

Posted by Jeff Smith on July 19, 2006
I agree that it is helpful to keep source code simpler for the purpose of troubleshooting, special modification, and code maintenance.

Because I make simple and well integrated solutions on small systems, I prefer to specifically design each application so it does not risk priority inversion. In the long run, I think doing it conciously helps streamline my small systems.


[ 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