- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Queues are meant to send data between threads so I guess there is already a synchronization mechanisim inside but since I didn't see it in the documentation. I wanted to ask.
do queues in wiced sdk have internal synchronization mechanism? or should we use a mutex
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a queston about ThreadX at here : multithreading - access a threadx-queue concurrently - Stack Overflow
This maybe a fundemental for embedded programming, but I thing it should written at docs (not shown at 5.0.1 doc).
Another question, how can I find which backend I am using (ThreadX, RTOS, etc) ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a queston about ThreadX at here : multithreading - access a threadx-queue concurrently - Stack Overflow
This maybe a fundemental for embedded programming, but I thing it should written at docs (not shown at 5.0.1 doc).
Another question, how can I find which backend I am using (ThreadX, RTOS, etc) ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
riforifo wrote:
Hello,
Queues are meant to send data between threads so I guess there is already a synchronization mechanisim inside but since I didn't see it in the documentation. I wanted to ask.
do queues in wiced sdk have internal synchronization mechanism? or should we use a mutex
thanks
Both ThreadX and FreeRTOS provide thread safe APIs to access the queue.
However, the WICED API level is racy for ThreadX build because it directly
dereferences the data structure in the RTOS.
e.g. wiced_rtos_get_queue_occupancy/wiced_rtos_is_queue_empty/wiced_rtos_is_queue_full
Add locking does not help, because the RTOS does not hold the lock adding by WICED API layer while accessing the data structure.
It's simply buggy.