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

Essential C++ Interview Questions: How to Make Static Member Functions Elegant and Safe?

Essential C++ Interview Questions: How to Make Static Member Functions Elegant and Safe?

Creating content is not easy, if convenient, please follow, thank you. Click on “C++ Players, please get ready” below, select “Follow/Pin/Star the public account” for valuable content and benefits, delivered to you first! Recently, some friends said they did not receive the articles pushed on the same day, which is due to WeChat changing the … Read more

ChaiScript: An Embedded Scripting Language Tailored for C++

ChaiScript: An Embedded Scripting Language Tailored for C++

In modern software development, embedded scripting languages are widely used to extend the functionality of applications, especially in scenarios requiring dynamic interaction. For C++ developers, ChaiScript is an excellent embedded scripting library that provides a simple and easy-to-use interface while seamlessly integrating with the C++ language. What is ChaiScript? ChaiScript is an embedded scripting language … Read more

Singleton Pattern: The Guardian of Global State Consistency in Embedded Systems

Singleton Pattern: The Guardian of Global State Consistency in Embedded Systems

1. Singleton Pattern The Singleton Pattern ensures that a class has only one instance and provides a global access point. Core structure diagram of the Singleton Pattern: The structure typically includes: A private static instance (pointer to itself) A private constructor (to prevent external instantiation) A public static method (to get the unique instance) In … Read more

lwprintf: A Tailored printf Implementation for Embedded Systems – Say Goodbye to Bloat and Embrace a Lightweight printf Library

lwprintf: A Tailored printf Implementation for Embedded Systems - Say Goodbye to Bloat and Embrace a Lightweight printf Library

In embedded system development, the <span>printf</span> function is like an old friend, facilitating debugging and information output. However, the standard library’s <span>printf</span> is often too large, consuming precious memory resources, which is a heavy burden for resource-constrained embedded systems. Today, we are excited to introduce a lightweight and efficient <span>printf</span> library—lwprintf—that will completely change your … Read more

FreeRTOS Part Two: Tasks

FreeRTOS Part Two: Tasks

FreeRTOS Tasks Let’s continue Bob’s open-source FreeRTOS series articles. The core of FreeRTOS is the task. In this second part, I will explore what a task is, what options are available to configure the Task Control Block (TCB), and what functionalities might be missing in the FreeRTOS TCB. As I grew up, I gradually discovered … Read more

In-Depth C++ Singleton Pattern: Principles, Implementation Comparisons, and shared_ptr Architecture Design

In-Depth C++ Singleton Pattern: Principles, Implementation Comparisons, and shared_ptr Architecture Design

#cpp #singleton 📌 In-Depth C++ Singleton Pattern: Principles, Implementation Comparisons, and shared_ptr Architecture Design 1️⃣ What is a Singleton? Basic Semantics and Usage Scenarios A Singleton ([[Singleton]]) is one of the most common object creation patterns, aimed at ensuring that a class has only one instance in the system and provides a global access point. … Read more

Enhancing Programmers’ Self-Cultivation

Enhancing Programmers' Self-Cultivation

Table of Contents 1.1 Starting with Hello World 1.2 The Essence Remains Unchanged 1.3 The Higher You Stand, The Further You See 1.4 What the Operating System Does 1.4.1 Don’t Let the CPU Doze Off 1.5 What to Do When Memory is Insufficient 1.5.1 About Isolation 1.5.2 Segmentation 1.5.3 Paging 1.6 Many Hands Make Light … Read more