zephyr alternative for Nordic's ATFIFO #78782
Unanswered
asteriskSF
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently porting an existing NRF SDK code base to NRF Connect SDK (Zephyr)..
Our existing code used NRF_ATFIFO to communicate events from interrupts and multiple subsystems. Upon inserting an event into the NRF_ATFIFO, processing is scheduled based on an atomic flag. The processing would pop the events from the NRF_ATFIFO so they would be processed in order.
Important attributes of this system:
lock free, and thread safe to use from ISR or scheduled processing
statically allocated
multiple producers, single consumer
producers do not have pre-determined resource allocations
low overhead insertion
I cannot find an equivalent replacement within Zephyr's API's.
K_fifo uses linked lists and requires the producer to provide the data storage, or alternatively uses dynamic allocation.
MPSC is same as k_fifo (linked list, producer provides memory)
ring buffer is not lock-free / thread safe for multi producer scenario
I considered porting nordic's atfifo but it relies on assembly functions that I expect will create issues.
I would like something like
https://github.com/max0x7ba/atomic_queue
but in a C implementation instead of C++.
Beta Was this translation helpful? Give feedback.
All reactions