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


Reduce memory usage with Mutex Semaphore

Posted by Boris Estudiez on March 8, 2011

I need to create 30 mutex semaphores for shared resources.

Each mutex uses a queue, so 30 x 76 bytes = 2280 bytes...too much RAM for
my MCU.

My question is, How I can implement mutex or similar mechanism without using too RAM ?.

Thanks in advance.

Boris Estudiez.-


RE: Reduce memory usage with Mutex Semaphore

Posted by Dave on March 8, 2011
My question would be, why do you need 30 mutexes? Are you sure you have an optimal design?

RE: Reduce memory usage with Mutex Semaphore

Posted by Richard on March 8, 2011
Mutexes have a lot to do - they have all the event information contained within them (instead of in a separate event control block), control how things queue waiting for the mutex, ensure things queue in priority order, implement priority inheritance, allow blocking on mutex receives, etc. If you need all that, then use a mutex, if you don't and your usage scenario is more simply, then you can implement something more simply, even some sort of protected shared variable might do.


RE: Reduce memory usage with Mutex Semaphore

Posted by Boris Estudiez on March 8, 2011
Hi, I need 30 mutexes becouse I have a script running on two tasks (A & B).

Task A and B share the same resources. Task B has higher priority than task A.

In my device, the script is loaded by a customer, so the access to the shared resources
must be transparent.

I need priority inheritance when task B try to access to the resources.

Boris Estudiez.-

[ 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