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


Send broadcast message or semaphore post ...

Posted by debugasm on December 14, 2013


is there a way to send a "broadcast message" through a queue or "semaphore post" to more than one recipient at the same time, without sending the message to a single recipient with loop (for() or while()) ?

Thanks very much.


Send broadcast message or semaphore post ...

Posted by rtel on December 14, 2013

You can't do that using a semaphore, but you can using the new event groups implementation. Event groups are not in the current release, but can be obtained from SVN. See https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/include/event_groups.h for documentation.


Send broadcast message or semaphore post ...

Posted by debugasm on December 14, 2013

Just what I needed for use multi-bit syncronize, like as uC-OS-xxx.

For send a message broadcast to multiple "message queue", there is something ?

Thanks very much.


Send broadcast message or semaphore post ...

Posted by rtel on December 14, 2013

Not directly, but you can create the same effect using event bits to have tasks wait on an event signally a post to a queue, then have each task peek the queue to get the message. You can use the queue overwrite function to have a single message in the queue that is updated by a writer.

The logic of broadcasting a message implies the message is copied individually to every task that is waiting, which is a lengthy and non-deterministic operation (FreeRTOS does not allow lengthy or non-deterministic operations). Without that (just copying the message to a single place) it would create logic problems for the application writer - what would happen if the tasks waiting for the message were of different priorities and the low priority tasks didn't get a chance to run before the message was updated? Etc. One day we may figure out small and deterministic ways of implementing these things without doing things like walking lists with interrupts disabled (or other such thing that is banned from the FreeRTOS implementation) and then provide it in the main code, but I can't say when that will be. Software timers and event bits have similar problems (anything basically that has to service a list of non-determinant length), but we are happy with the solutions we came up with for those, so there is no reason why we would not eventually do the same for broadcast messages. [you are able to do the opposite - that is - have a task wait for messages on multiple queues]


[ 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