What is atomic_load in C ?

Syntax

C atomic_load( volatile A* obj );

The atomic_load function atomically returns the value that the obj is pointing to. The volatile keyword informs the compiler that the value of this variable may change anytime.

This is an atomic operation that uses sequential consistency - memory_order_seq_cst. The memory order is given as an argument to those functions that carry out atomic operations. It states how operations on various threads are synchronized.

Explanation

A - one of the atomic types.

C - A's corresponding non-atomic type.

Parameters

The function takes in one parameter, as stated below:

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

Return value

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

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved