Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

c

What is atomic_load_explicit in C ?

Sheza Naveed

Syntax

The atomic_load function atomically returns the value that the obj is pointing to. It is defined for all atomic types and does not throw exceptions. The volatile keyword informs the compiler that the value of this variable may change anytime.

Explanation

A - one of the atomic types.

C - A's corresponding non-atomic type.

Parameters

obj - the pointer to the atomic object that has to be read.

order - the order of memory synchronization for this operation. This will be executed by one of the following values. These are of the enum type memory_order:

  • memory_order_seq_cst
  • memory_order_consume
  • memory_order_acquire
  • memory_order_relaxed

Return value

The value of atomic variable that the object is currently pointing at.

RELATED TAGS

c

CONTRIBUTOR

Sheza Naveed
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring