Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementation of semaphore in Queues in freeRtos

Tags:

task

freertos

Is queues in freeRtos from the beginning also mutual exclusive, by that i mean, shall i create some kind of mutual exclusion for writing or reading from a queue, or is it already implemented by the function xQueueRead and xQueueSend.

like image 565
user3712774 Avatar asked Jan 25 '26 10:01

user3712774


1 Answers

If you look at the source in "queue.c" you will notice that xQueueGenericSend() and xQueueGenericReceive() functions are using tastENTER_CRITICAL()/taskEXIT_CRITICAL() macro pair to ensure atomic operation of the function, which, in a sense, is kind of mutual exclusion you are asking for.

like image 131
Nenad Radulovic Avatar answered Jan 28 '26 12:01

Nenad Radulovic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!