Using Queues with one item
Posted: Tue Aug 18, 2020 7:39 am
HelloI am new to ESP32 and freeRTOS.
I use queues to sync two tasks. For that i use a sending and receving queues with
exactly one item. item can be anything eg: struct, integer, bool etc.
my synced task flow is like this.
task1
do something
send queue1
task1wait for queue2
task2
wait for queue1
receive queue1
do something
send queue2
task1
receve queue2
continue task1
Please assume that there is no deadlock scenario .
Tasks seems to be work fine.
But my problem is, In every free RTOS queue example i saw, queues were defined with more than one item.
Eventhough only one item is required still they used 2 or 3 items in a queue.
Why there is more than one item.
Are there any pitfalls of using one quque item.
Thank you;
I use queues to sync two tasks. For that i use a sending and receving queues with
exactly one item. item can be anything eg: struct, integer, bool etc.
my synced task flow is like this.
task1
do something
send queue1
task1wait for queue2
task2
wait for queue1
receive queue1
do something
send queue2
task1
receve queue2
continue task1
Please assume that there is no deadlock scenario .
Tasks seems to be work fine.
But my problem is, In every free RTOS queue example i saw, queues were defined with more than one item.
Eventhough only one item is required still they used 2 or 3 items in a queue.
Why there is more than one item.
Are there any pitfalls of using one quque item.
Thank you;