I need to share a buffer between threads without using queues or IPC. Is that possible in TI-RTOS? In linux I can do this without problem.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I need to share a buffer between threads without using queues or IPC. Is that possible in TI-RTOS? In linux I can do this without problem.
Yes, it is possible.
A simple example is to have a global array and multiple threads can access it. Note: a thread can be a interrupt (Hwi), software interrupt (Swi) or Task. Note: you'll need to provide thread-safety if multiple threads are reading/writing to the memory. For example
int someBuffer[128];
Void task1(UArg arg0, UArg arg1)
{
UInt key
...
key = Hwi_disable()
//quickly act on someBuffer
Hwi_restore(key)
Note: use Hwi_disable/restore if you have a quick action on the shared memory. If you are only having tasks access the memory, you can use GateMutex, Semaphores or Task_disable/restore to guard the memory accesses (each have their pros and cons).
Todd