Quality RTOS & Embedded Software

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


Waiting on task notifies and a queue

Posted by jgreen on December 1, 2016

The new task notify system seems great and I want to utilize it for fast interrupt to task notifies (with the event group flag mode). However, I'd also like to be able to send/receive queued messages from this same task to other lower priority tasks, for which I'm currently using a queue.

So my question is: how can the task wait on task notifies and the command queue? One thought I have is to just wait on task notifies and create a "RECVQUEUECMD" notify event which can be issued by other tasks after posting a message to the command queue. My question is, if there would be any potential race conditions between submitting the mesage to the queue and the task notify? What I mean, is would it be possible for the task notify to occur before the command has been posted to the queue? Or would the sequence of notify, followed by post to queue be atomic in sequence?

Thanks for any info on this.

Best regards,


Waiting on task notifies and a queue

Posted by rtel on December 1, 2016

Everything will happen sequentially - so if you post to the queue then send the notification the message will always be in the queue before the notification unblocks the task.

As you are using the "event group flag mode" perhaps you could use one of the bits to mean "there is a message in the queue"?

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

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 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