Concurrency Control and Thread Safety in Embedded Environments

Concurrency Control and Thread Safety in Embedded Environments

The increasing scale of code and multi-threading technology based on RTOS has made embedded software development more focused on “concurrency control and thread safety.” When multiple execution threads (referring to any context running code, including threads and interrupt service routines) need to access the same shared resources (including software data and hardware resources), errors may … Read more

Exploring Lock-Free Queues in C++: Various Implementations and Performance Comparisons

Exploring Lock-Free Queues in C++: Various Implementations and Performance Comparisons

Implementing a lock-free queue in C++ is a complex task because lock-free programming involves intricate memory operations and synchronization mechanisms, requiring a deep understanding of concurrent programming and hardware-level atomic operations. The advantage of lock-free queues is that they can provide better performance in high-concurrency scenarios, as they avoid the thread contention and context-switching overhead … Read more

Understanding C++ Memory Model

Understanding C++ Memory Model

↓Recommended to follow↓ This article is a sister piece to “C++ Concurrency Programming”. It will focus on the memory model introduced by the C++11 standard. Introduction In the article “C++ Concurrency Programming”, we have already introduced the new APIs in concurrent programming from C++11 to C++17. With the knowledge from that article, you should be … Read more

Mastering Parallel Tasks with Multiprocessing in Python

Mastering Parallel Tasks with Multiprocessing in Python

In Python, the `multiprocessing` module is part of the standard library, designed to support parallel computing and multi-process programming. Unlike threading, `multiprocessing` achieves task parallelization by creating independent processes, which not only bypasses the limitations of Python’s Global Interpreter Lock (GIL) but also fully utilizes multi-core CPUs to improve program execution efficiency.Today, we will briefly … Read more

Parallel Computing: Implementing Parallelism with Multiprocessing Module

Parallel Computing: Implementing Parallelism with Multiprocessing Module

Parallel Computing: Implementing Parallelism with Multiprocessing Module In modern computing, when processing large amounts of data or performing complex calculations, a single-threaded approach often fails to meet performance demands. To address this issue, we can leverage parallel computing to enhance program efficiency. In Python, the multiprocessing module provides a simple yet powerful interface that allows … Read more

FreeRTOS Part Four: Inter-Process Communication

FreeRTOS Part Four: Inter-Process Communication

We continue Bob’s open-source FreeRTOS series articles. One of the core elements of an RTOS is the rich Inter-Process Communication (IPC) API. In this fourth part, Bob will introduce the IPC available in FreeRTOS and compare it with Linux. One of the concepts that has had the greatest impact on my career as an embedded … Read more

Rust: The Next Generation Programming Language for Industrial Automation System Development

Rust: The Next Generation Programming Language for Industrial Automation System Development

The programming language Rust, known for its exceptional speed, safety, and performance, is gradually attracting more attention. Some companies have begun to leverage Rust to address critical and complex issues in the field of industrial automation. Image source: Rockwell Automation Industrial automation is a unique field with its own complexities and critical systems that maintain … Read more

Exploring the Path of Rust Programming: Learning Notes from Design Philosophy to Memory Safety

Exploring the Path of Rust Programming: Learning Notes from Design Philosophy to Memory Safety

Exploring the Path of Rust Programming: Learning Notes from Design Philosophy to Memory Safety In the programming world, Rust has rapidly risen to prominence as a new favorite for system-level programming due to its features of memory safety, zero-cost abstractions, and high performance. “The Rust Programming Path” is not just a technical book but a … Read more

Using Linux File Locking to Solve Multi-Process Concurrency Issues

Using Linux File Locking to Solve Multi-Process Concurrency Issues

Click on the above“Embedded and Linux Matters” Select“Pin/Star Public Account”Benefits and resources delivered promptly Hello everyone, I am the Information Guy~ As the project gradually comes to a close, I am summarizing some technical points of Linux application development. Since my project is a multi-process system, it involves issues of resource sharing among processes. The … Read more

Can Microcontrollers Truly Execute Multiple Tasks Simultaneously?

Can Microcontrollers Truly Execute Multiple Tasks Simultaneously?

Many students ask me: Why does my LED light blink while the serial port data reception gets stuck? I want to read data from two sensors simultaneously, why is it that one of them always reads incorrectly? Why can’t my program control the motor while sending data? The most classic question is: why can’t I … Read more