SDK14.2
A little background on this question.
I am creating a library where I need to add items to a queue and then process those items from the queue. I would like to know what SDK library would be better for this operation:
nrf_queue or nrf_atfifo library.
Basically, here is an example of how my library would work:
Someone can call DoFooA() from one thread and somone else can call DoFooB() from another thread. Both of these items will be added to the queue and the scheduler will call the process queue function some time and that function will process the items in the queue.
My question is what library should I use for this the nrf_queue library or the nrf_atfifo. Would there be any thread safety issues?
DoFooA(itemA) { addToQueue(itemA); app_sched_event_put(NULL, 0, DoProcessQueue); return SUCCESS } DoFooB(itemB) { addToQueue(itemB); app_sched_event_put(NULL, 0, DoProcessQueue); return SUCCESS } DoFooC(itemC) { addToQueue(itemC); app_sched_event_put(NULL, 0, DoProcessQueue); return SUCCESS } DoProcessQueue(void) { //process all the items in the queue here }