Skip to content

pico_atomic: atomic operations are not multicore-atomicΒ #1805

@geurtv

Description

@geurtv

From SDK 2.0.0 release notes:

Additional support for C11 atomic functions using spin lock number PICO_SPINLOCK_ID_ATOMIC.

and

On RP2040, all functions are implemented via spinlock.

Well ... no? PICO_SPINLOCK_ID_ATOMIC doesn't seem to be used anywhere in the pico-sdk sources and spinlocks are nowhere to be found in atomic.c.

The atomic operations in atomic.c call atomic_lock() which itself only calls save_and_disable_interrupts(), and if I'm not mistaken this only disables interrupts on the current cpu core.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions