FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2016 Threads]
Hi
We are using FreeRTOS version 8.0.1 and our interest is about the blocked task on empty/full queue.
We would like to have queue which can be closed.
Function close will wake up all tasks blocked on empty/full queue with special error code (or exception) and all future
requests for read or write to the queue will return this special error code (or exception).
Same functionality is described in paper [1] on http://www.open-std.org/.
Is it possible to achieve this functionality with FreeRTOS queues or another synchronization primitives?
Our system uses tasks which receive shutdown signal and after received it terminates itself.
But we started using queues for sending messages between tasks and this approach is not possible when task gets blocked on empty queue.
Our primary concern is to implement proper shutdown procedure for every task.
Thanks,
Ondrej
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3533.html#closed_queues
There is an outstanding feature request, which is scheduled to be implemented "soon" (?) to allow tasks that are in the Blocked state to wait for an event to abort their wait, and re-enter the Ready state. That may simplify your particular scenario, but other than that, there is no way to close a queue. Perhaps you could implement this using a wrapper around the queue functions, or possibly even using the trace macros (although you may find trace macros are only in place after a read/write to a queue has already passed or failed).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.