RT-Thread kernel-atomic operation ① RT-Thread Kernel-Atomic Operations Atomic operations Introduction to atomic operations Advantages of Atomic Operations Implementation and usage of RT-Thread atomic operations RT-Thread Atomic Operation API Comprehensive example RT-Thread kernel-atomic operation Atomic operations Introduction to atomic operations Atomic operation refers to an indivisible operation that either executes completely successfully or does not execute […]
Tag: atomic
BUG: scheduling while atomic detection mechanism principle and problem handling
All code analysis in this article is based on linux-5.4.18 1 BUG: scheduling while atomic During the task switching process, if the scheduler detects that the environment before switching is an atomic operation and task switching is prohibited, it will output an exception such as “BUG: scheduling while atomic:” and then decide whether to trigger […]
The nature of communication, communication methods, the principles and multiple characteristics of anonymous pipes (access control, pipe_buf, atomicity, half-duplex), pipe() + simulation implementation code, communication between multiple processes (anonymous pipes, simulation implementation code )
Table of Contents communication introduce Why should there be communication? the nature of communication How to communicate pipeline system V posix standard Signal pipeline introduce anonymous pipe Principle introduce process Implement — pipe() function prototype parameter return value mock code Features Used for communication between parent and child processes Provide access control When the buffer […]
Punctual Atomic Embedded Linux Driver Development–Linux 4G Communication
I have learned previously how to use a wired network or WIFI in Linux, but there are many restrictions on using a wired network or WIFI because wiring is required. Even WIFI must be wired first and then connected to a wireless router. There are many occasions where wiring is inconvenient. This is when 4G […]
C++11 atomic weight implements spin lock
Linux C/C++ development (backend/audio/video/game/embedded/high-performance network/storage/infrastructure/security) growth system 1. Spin lock Spin lock is a basic synchronization primitive used to ensure mutually exclusive access to shared data. Compared with the mutex lock, when the lock acquisition fails, the thread will not be blocked but will keep spinning trying to acquire the lock. When the thread is […]
12 Atomicity|Visibility|Ordering|JMM memory model
Table of Contents 1 Three major characteristics of concurrency 1.1 Atomicity 1.2 Visibility 1.3 Orderliness 2 Java Memory Model JMM 2.1 Abstract structure of JMM 2.2 Main memory and working memory interaction protocol 2.3 Memory semantics of locks 2.4 volatile memory semantics 2.4.1 Semantics of volatile writing 2.4.2 Semantics of volatile read 2.4.3 Implementation principle […]
CUDA Programming (9) Reasonable use of atomic functions
Functions that implement atomic operations are referred to as atomic functions. In CUDA, an atomic operation of one thread can complete a set of “read-modify-write” operations on a certain data (in global memory or shared memory) without being affected by any operations of other threads. This set of operations can also be said to be […]
Zhengdian Atomic Embedded Linux Driver Development – Linux comes with LED driver
Previously, I wrote my own LED light driver. In fact, very basic device drivers like LED lights have been integrated into the Linux kernel. The LED light driver of the Linux kernel uses the platform framework, so you only need to add the corresponding LED nodes in the device tree file as required. This chapter […]
Punctual Atomic Embedded Linux Driver Development – Linux Kernel Timer
Timer is the most commonly used function. It is generally used to complete timing functions. In this chapter, we will learn about the timer API functions provided by the Linux kernel. Through these timer API functions, many applications that require timing can be completed. . The Linux kernel also provides short delay functions, such as […]
C language – atomic operations
Basic concepts In the C language (especially after the C11 standard), atomic operations provide a mechanism that allows programmers to directly operate on data in a concurrent environment without using mutexes or other synchronization primitives, while ensuring the integrity of the data. Completeness and consistency. The core idea of atomic variables and atomic operations is […]