Give feedback

How would you rate this Learning Path?

Review frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Where should I save the example and which headers does it need?
Save the program as atomic.c. Include stdio.h, threads.h, and stdatomic.h.
How many threads and iterations does the example use?
You’ll create 10 threads, with each thread performing 1,000 increments of both the non-atomic and atomic counters.
What result should I expect when I run the program?
Confirm that the atomic counter reports the total increments across all threads. Your non-atomic counter can report a different value because concurrent updates create data races.
How do I verify whether the compiler generated LSE instructions?
Run the objdump command and check its count of LSE atomic instructions. You can also inspect the disassembly for instructions such as ldaddal.
How can I check whether my Arm-based Linux system supports LSE?
Run sudo dmesg | grep LSE and look for a message that reports detected LSE atomic instructions. You can also run lscpu | grep Flags. The atomics flag indicates LSE support.

Share

Tell others about this Learning Path.

Return to Servers and Cloud Computing