Module atomic

Module atomic 

Source
👎Deprecated since 1.3.0: please use the portable-atomic crate
Expand description

A collection of atomic “polyfill” routines, to use a term from JavaScript.

ARMv6-M processors like the Cortex-M0 don’t support the fancier atomic operations available on most other ARM processors. In particular, they have no atomic swap or read-modify-write instructions. This module provides traits that use the native atomics on M3 and later, and fallback implementations on M0.

The M0 implementations rely on disabling interrupts. This means that:

  1. They will hurt interrupt latency/jitter. However, the M0 already has pretty poor interrupt latency/jitter because of uninterruptible instructions and lack of BASEPRI. So, not a big loss.

  2. They don’t work in unprivileged mode. But, neither does most of lilos.

This is exposed so that applications don’t have to rewrite it for M0 support.

Traits§

AtomicArithExtDeprecated
Atomic operations that apply to arithmetic types.
AtomicExtDeprecated
Basic atomic operations.