Atomic

    An encapsulation of an atomic primitive object.

    atomics.swift:190

    This declaration is deprecated: please use ManagedAtomic from https://github.com/apple/swift-atomics instead

    final class Atomic<T> where T : AtomicPrimitive

    Atomic objects support a wide range of atomic operations:

    • Compare and swap

    • Add

    • Subtract

    • Exchange

    • Load current value

    • Store current value

    Atomic primitives are useful when building constructs that need to communicate or cooperate across multiple threads. In the case of SwiftNIO this usually involves communicating across multiple event loops.

    By necessity, all atomic values are references: after all, it makes no sense to talk about managing an atomic value when each time it’s modified the thread that modified it gets a local copy!

    Citizens in NIOConcurrencyHelpers

    Type members

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Instance members

    Show obsolete interfaces (6)

    Hide obsolete interfaces

    Citizens in NIOConcurrencyHelpers

    Conformances

    • protocol Sendable

      A type whose values can safely be passed across concurrency domains by copying.