Menu

#120 xQueueReceive needs to indicate more messages waiting

closed
nobody
None
5
2020-02-25
2017-08-01
Roland
No

A developer working on a sophisticate task will commonly want to sleep on a combination of timers, queues, and incoming messages. Using an event group is the elegant solution to coordinate these things.

Currently, the xQueueReceive function must be followed up by an uxQueueMessagesWaiting call to determine if a task needs to reactivate the event to indicate incoming messages still in the message queue. This amounts to having to enter a critical section twice when once should have been sufficient. Please add add a third return value to xQueueReceive to indicate "success but not empty".

Discussion

  • Roland

    Roland - 2017-08-01

    I meant timers, queues (messages), and raw events.

     
  • Richard Damon

    Richard Damon - 2017-08-02

    One big problem with adding a second successful return value is that it is quietly breaking change. Any task that tests the return value of xQueueReceive() with an equal test to ok, will suddenly not work right.

    My solution to something like that, is to pull the data out of the Queue with a while Ok loop with a delay value of 0 before returning to the block on the event group.

     
  • Richard Barry

    Richard Barry - 2020-02-25
    • status: open --> closed
     
  • Richard Barry

    Richard Barry - 2020-02-25

    There is already a workaround, and changing the API would be a big breaking change.

     

Log in to post a comment.

MongoDB Logo MongoDB