Quality RTOS & Embedded Software

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


Queuing items with timeouts

Posted by incrediball on June 25, 2011
I have an idea / feature request:

I often find myself in the situation when I want to put something in a queue for a while, i.e. give it a timestamp when the receiving task is able to retrieve the item. Often it may be the same task that has retrieved a command from a command queue but isn't able to process it at that time (because something may be busy and we don't want to wait for it), then it would be nice to stick it back in the queue but not have to deal with the problem that the task will just immediately fetch the item out of the queue again. Doing a forced delay before calling xQueueReceive is not always appropriate because the task might have other things to do.

The idea is that xQueueReceive blocks until an item in the queue times out and then it is returned. Note that unlike regular queues, the items would be returned in the order in which they time out - not in the order that they were posted. So, strictly speaking it wouldn't really be a queue.

Just an idea but I can't really figure out an elegant way of dealing with this situation without something like this.

[ 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.

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.


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


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