Skip to content

Non-atomic version of bip_buffer_spsc_atomic ? #1294

Description

@serges147

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions