Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Nested Mutexes and Priority Inheritance

Posted by Chris on March 22, 2010
Hi,

I am using an Atmel AVR32 uP (UC3A0512) and have based most of my application around the drivers provided by Atmel's Software Framework. The documentation for freeRTOS mentions " ... the priority inheritance mechanism implemented by mutexes is only a basic form that assumes that a task will only hold a single mutex at any one time ... ". What is likely to happen if a task were to hold more than 1 mutex at a time? I ask this as it seems the Atmel's file system will cause a task to hold 2 mutexes. There is a mutex on the SPI hardware (for access to a dataFlash/SdCard) and another mutex on the higher level file operations. Is this likely to cause problems?

Thanks,
Chris.

RE: Nested Mutexes and Priority Inheritance

Posted by Richard on March 23, 2010
Whether or not it will cause problems depends on the the priorities of the tasks holding the mutexes.

The priority inheritance assumes that only one mutex will be held at a time. If two mutexes are held then the priority will be inherited to that of the highest task priority that is attempting to access the same mutex, but will be dropped back to the base priority when either mutex is returned. This could result in some priority inversion, but this won't necessarily cause you a problem, and in fact some inversion must have already existed for the inheritance to have been triggered in the first place.

Regards.

RE: Nested Mutexes and Priority Inheritance

Posted by Chris on March 23, 2010
OK, so FreeRTOS won't get upset by it, my application may not behave as I'd expected.

Thanks Again,
Chris.


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


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner