Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the SPSC implementation really need portable atomics / cas? #466

Open
MarcusGrass opened this issue Apr 13, 2024 · 0 comments
Open

Comments

@MarcusGrass
Copy link
Contributor

Hi,

I made a somewhat broken migration of a non-thread-safe SPSC to a thread-safe one looking at the SPSC implementation here for guidance.

I came over this part of the docs

This module requires CAS atomic instructions which are not available on all architectures
(e.g. ARMv6-M (thumbv6m-none-eabi) and MSP430 (msp430-none-elf)). These atomics can be
emulated however with portable-atomic, which is
enabled with the cas feature and is enabled by default for thumbv6m-none-eabi and riscv32
targets.

But the implementation doesn't seem to use any CAS-instructions at all.

I'm not that familiar with embedded so maybe there's something I'm missing here, does the SPSC really need portable_atomic (if #[cfg(target_has_atomic_load_store = "ptr")], important caveat`, shouldn't be necessary if the target has atomic load store).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants