Quality RTOS & Embedded Software

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




Loading

Reduce memory usage with Mutex Semaphore

Posted by Boris Estudiez on March 8, 2011
Hi,

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.

Regards,
Boris Estudiez.-

http://www.slicetex.com.ar





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.

Regards.

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.

Regards,
Boris Estudiez.-


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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