Hello!
So far I successfully used etl::bip_buffer_spsc_atomic for BIP buffer behavior but my environment is completely single threaded (plain old super loop), single CPU core, and there is no even ISR involved. So, it would be nice to have an alternative - a bit more lighter variant of the buffer (with exactly the same public API) but without atomics inside (and so not dependent on ETL_HAS_ATOMIC).
My question (probably for maintainers):
- Should it be a new
bip_buffer_spsc class/file (essentially almost full copy/paste of the atomic version but with plain size_type index fields (read, write & last)?
- OR, some efforts should be invested into trying to extract common functionality (which is a lot!) into some base class for both cases?
Please share Your thoughts on that.
Thanks!
P.S. Maybe it's not applicable analogy, but just in case, if we look at etl::queue_spsc_xxx variants then it seems that the former approach is taken, namely copy/paste one.
Hello!
So far I successfully used
etl::bip_buffer_spsc_atomicfor BIP buffer behavior but my environment is completely single threaded (plain old super loop), single CPU core, and there is no even ISR involved. So, it would be nice to have an alternative - a bit more lighter variant of the buffer (with exactly the same public API) but without atomics inside (and so not dependent on ETL_HAS_ATOMIC).My question (probably for maintainers):
bip_buffer_spscclass/file (essentially almost full copy/paste of the atomic version but with plainsize_typeindex fields (read,write&last)?Please share Your thoughts on that.
Thanks!
P.S. Maybe it's not applicable analogy, but just in case, if we look at
etl::queue_spsc_xxxvariants then it seems that the former approach is taken, namely copy/paste one.