This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS KEIL RTOS - Using protected global structure vs Memory pool usage

Dear all,

I am using Keil 5.16 and CMSIS Keil RTX RTOS. I am analysing my design scenario in which I need to share a data structure between two threads created using osThreadCreate(). One thread will be writing to this data structure. Another thread will be reading from this data structure. Reading/writing can happen simultaneously. I understood there are two possibilities.

One option is to maintain a global structure and both threads read/write to this structure by protecting using a mutex.

Another option is to maintain the structure within a memory pool created and both threads read/write to this pool protected using a mutex.

Can anyone tell me which is the effective solution? As all the threads run in the same address space, theoretically I didn't feel any difference if it is a global data structure or is maintained in a pool.. Can you share your thoughts on this?

Thank you,
Lullaby Dayal