Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::atomic_ref<T>::is_lock_free

      From cppreference.com
      <cpp‎ |atomic‎ |atomic ref
       
       
      Concurrency support library
      Threads
      (C++11)
      (C++20)
      this_thread namespace
      (C++11)
      (C++11)
      (C++11)
      Cooperative cancellation
      Mutual exclusion
      Generic lock management
      (C++11)
      (C++11)
      (C++11)
      (C++11)
      Condition variables
      (C++11)
      Semaphores
      Latches and Barriers
      (C++20)
      (C++20)
      Futures
      (C++11)
      (C++11)
      (C++11)
      Safe reclamation
      Hazard pointers
      Atomic types
      (C++11)
      (C++20)
      Initialization of atomic types
      (C++11)(deprecated in C++20)
      (C++11)(deprecated in C++20)
      Memory ordering
      (C++11)(deprecated in C++26)
      Free functions for atomic operations
      Free functions for atomic flags
       
      std::atomic_ref
      Member functions
      atomic_ref::is_lock_free
      Operations for arithmetic types
      (exceptbool and pointer-to-object)
      Operations for integral types
      (exceptbool and pointer-to-object)
      Operations for integral types
      (exceptbool)
      Constants
       
      bool is_lock_free()constnoexcept;
      (since C++20)

      Checks whether the atomic operations on this object are lock-free.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      true if the atomic operations on this object are lock-free,false otherwise.

      [edit]Notes

      All atomic types except forstd::atomic_flag may be implemented using mutexes or other locking operations, rather than using the lock-free atomic CPU instructions. Atomic types are also allowed to besometimes lock-free, e.g. if only aligned memory accesses are naturally atomic on a given architecture, misaligned objects of the same type have to use locks.

      The C++ standard recommends (but does not require) that lock-free atomic operations are also address-free, that is, suitable for communication between processes using shared memory.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      indicates that the type is always lock-free
      (public static member constant)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/atomic/atomic_ref/is_lock_free&oldid=161434"

      [8]ページ先頭

      ©2009-2026 Movatter.jp