RT-Thread kernel-atomic operation ①

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 […]

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 […]

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 […]

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 […]