Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++CodeRAD Studio

Powerful Atomic Operations In C++ – No Oppenheimer Required

Powerful Atomic Operations In C++ No Oppenheimer Required

Hello C++ developers, Yilmaz here from LearnCPlusPlus. RAD Studio’s C++ BuilderDelphi and their free community editions C++ Builder CEand Delphi CE are a real force for modern application development. Our educational LearnCPlusPlus.org web page is another powerful element for learning details of modern C++ programming. It is growing well thanks to you, and we have many new readers, thanks to your support!

The LearnCPlusPlus.org site has unique and new posts with examples suitable for everyone from beginners to professionals alike. The site features a plethora of posts which are great to learn the features of modern C++ compilers with very simple explanations and examples. In this round-up of recent articles, we explain atomics and atomics operations, which are the multi-threading features of modern C++ along with other useful methods for developers. You don’t have to be Robert Oppenheimer to get to grips with atomic operations in C++ so put away your safety googles and relax as we take you through the details.

In modern C++, multi-thread operations have evolved amazingly since C++11, and still, there are new improvements in the latest standards to enhance multi-thread operations further. The concurrency support library in modern C++ is designed to solve problems in multi-thread operations. Since the C++11 standard, this library includes built-in support for threads (std::thread) with atomic operations (std::atomic).

Where I can I learn about atomic operations in C++ with a free C++ compiler?

If you don’t know anything about C++ or the C++ Builder IDE, don’t worry, we have a lot of great examples on the LearnCPlusPlus.org website and they’re all completely free. Just visit this site and copy and paste any examples there into a new Console, VCL, or FMX project, depending on the type of post. We keep adding more C and C++ posts with sample code. In today’s round-up of recent posts on LearnCPlusPlus.org, we have new articles with very simple examples that can be used with:

Read the FAQ notes on the CE license and then simply fill out the form to download C++ Builder 11 CE.

How can I use atomic operations in C++ Builder?

The concurrency support library in modern C++ is designed to solve problems in multi-thread operations. Since the C++11 standard, this library includes built-in support for threads (std::thread) with atomic operations (std::atomic). C++11 adds atomic types and operations to the standard. Atomic types and operations provide a way of writing multi-threaded applications without using locks. In the next post, we explain what is std::atomic and how we can use atomic types efficiently in modern C++.

Atomic types are special in multi-threading operations and they can be used to count things, to sum, and to calculate some data types. The fetch_add and the fetch_sub are atomic addition operations that atomically replaces the current value with the result of arithmetic addition or subtraction of the given value. In the next post, we explain two atomic operations that can be used with std::atomic types, we explain what are atomic addition and subtraction operations.

Logic operations are really important when your code line decides what to do or what to modify in bits, this is also important in multi-threading applications. Atomic types can be used in logical operations as in standard C++ types, for example, we can use fetch_and, fetch_or, and fetch_xor in atomic operations. In the next post, we explain atomic logic operations that can be used with std::atomic types.

Normally, if your threads try to read and write the same data, it is obvious that there are big problems in your application. In C++11, multi-threading is evolved by the atomic library with loading and storing data options securely. Atomic load and store operations are load, atomic_load, atomic_load_explicit, store, atomic_store, and atomic_store_explicit. In the other post, we explain what two atomic operations that can be used with std::atomic types, we explain what are atomic load and store operations.

In C++ programming we can use many different ways to call functions. One of the features of C11 is a functor, an early function object in C++. The functor function objects are callable objects. A functor or function object is any object for which the function call operator is defined. In the last post, we learn what a functor is and how we can use a functor in C++.

What are atomic operations in C++ and how can I use them?

LearnCPlusPlus.org has been producing full of educational daily articles about C and modern C++ that can be used with C++ Builder, C++ Builder CE, Dev-C++, BCC Compiler and some other compilers such as the GCC compiler. Here are our post picks for today.

The concurrency support library in modern C++ is designed to solve problems in multi-thread operations. Since the C++11 standard, this library includes built-in support for threads (std::thread) with atomic operations (std::atomic). In this post, we explain two atomic operations that can be used with std::atomic types, we explain what are atomic addition and subtraction operations.

We like to hear your feedback. You motivate us so much with your likes and comments on social media (find us on Facebook, LinkedIn, Reddit, Twitter / X and all over) and here on the blogs too. Thank you for your valuable comments and questions. All of them help improve the quality of our future posts and new code in these posts.

We have a lot of unique posts waiting to come. We keep adding new topics every week about C++ in general and specific topics for C++ Builder, Dev-C++, and for the other C++ compilers. Please keep following our LearnCPlusPlus.org website for the latest posts and updates. Feel free to comment and share with your colleagues, students, members – knowledge is power, and knowledge shared is empowering.

Do you want to know some more on what is planned for C++ Builder 12?

C++Builder 12 plans to bring some massive improvements. Join us for a sneak peek behind the scenes, showcasing in-development tech in two major areas: the enhanced Clang toolchain and Visual Assist integration. Uncover massive improvements across RTL, STL, debugging, and more.

August 31 at 10 AM CST. Save your seat: https://bit.ly/BehindtheBuild-RAD-CBuilder-12

Behind the build RAD Studio and C++ Builder 12

What might be next force may be for C++ Builder?

According to David Millington’s post, C++ Builder is aiming to include some amazing features; CLANG v15, support for C++20 and a lot of C++23 features, Win64 primary OS, new code completion, Visual Assist C++ navigation and refactoring, and lots more.

Disclaimer: All new features and improvements discussed in posts regarding future versions of RAD Studio are not committed until completed, and GA released.

Note that Embarcadero announced the release of RAD Studio 11 Alexandria Release 3, also known as RAD Studio 11.3, along with Delphi 11.3 and C++Builder 11.3. This release is focused on quality and improvements, building on the great new features in RAD Studio 11 Alexandria three previous releases.

Learn Multi threading with Concurrency Support Library in C++ C++ Builder logo

C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.

There is a free C++ Builder Community Edition for students, beginners, and

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES