A Powerful Inter-Process Communication Tool for Embedded Systems!

A Powerful Inter-Process Communication Tool for Embedded Systems!

Follow our official account to keep the embedded knowledge flowing! 1. Communication in Embedded Systems In embedded Linux projects, there are various options for inter-process communication: Message Queues (POSIX MQ): Complicated API, message size is limited (usually 8KB), and cross-machine communication requires rewriting. Shared Memory + Semaphores: Best performance, but requires manual synchronization, which can … Read more

Implementing a Message Queue in C++

Implementing a Message Queue in C++

Have you ever experienced two processes frantically competing to read and write data, resulting in either fragmented data or the program getting stuck in “synchronization wait”?It’s like a cafeteria where no one is in line, everyone is pushing at the window, and in the end, the food spills, and no one gets to eat well. … Read more

HeliOS: An Open Source Lightweight Embedded Operating System

HeliOS: An Open Source Lightweight Embedded Operating System

HeliOS is an open-source, free embedded multitasking kernel designed for various low-power embedded devices. It provides a rich, well-documented API that allows for fine control of the system and access to kernel services (system calls), enabling functionalities such as task management, scheduler management, inter-process communication, memory management, and device management, all while maintaining a minimal … Read more

Python IPC 1: TCP-Based Socket Communication Example

Application Scenario Inter-process communication across networks, with connection and reliable transmission. TCP-Based Socket Communication Process TCP Server TCP Client 1、socket() 1、socket() 2、bind() 3、listen() 4、accept() <———————– 2、connect() 5、recv() <———————— 3、send() 6、send() ————————-> 4、recv() 7、close() 5、close() Description: socket(): Create a socket. bind(): The server binds the IP and port,called only by the server. listen(): The server starts … Read more

Inter-Process Communication in Linux Using FIFO

In the article “Running Shell Scripts in Linux C Code to Get Their Return Values,” the concept of “anonymous pipes” was mentioned, which allows communication between parent and child processes through the use of fork. However, this is limited to communication between a parent and its child or between two child processes with the same … Read more

Exploring the Many Uses of Linux Pipes

Exploring the Many Uses of Linux Pipes

Source | TLPI System Programming Notes Compiled & formatted | Embedded Application Research Institute Overview The most common use of pipes is in the shell, for example: $ ls | wc -l To execute the above command, the shell creates two processes to execute <span>ls</span> and <span>wc</span> (achieved through <span>fork()</span> and <span>exec()</span>), as shown below: … Read more

Summary of Linux IPC (Inter-Process Communication) – Semaphores, Shared Memory, Message Queues, and Pipes (Part 1)

Summary of Linux IPC (Inter-Process Communication) - Semaphores, Shared Memory, Message Queues, and Pipes (Part 1)

Note: Please indicate the source when reprinting, all rights reserved.Note: This is based on my own understanding,if it conflicts with your principles and ideas, please forgive me and do not criticize. Environment Description Linux 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Introduction 1. IPC – Inter-Process Communication 2. UNIX … Read more

Inter-Process Communication (IPC) in C++

Inter-Process Communication (IPC) in C++

In C++, Inter-Process Communication (IPC) is a mechanism that allows multiple independent processes to exchange data and coordinate operations. Below are detailed descriptions of three common IPC methods: 1. Pipes Pipes are a half-duplex communication method where data can only flow in one direction, and they are divided into anonymous pipes and named pipes. Anonymous … Read more

Example of Communication Between Qt C++ and Python Using Shared Memory

Example of Communication Between Qt C++ and Python Using Shared Memory

Below is a complete example of implementing communication between Qt C++ and Python using shared memory. This example consists of two parts: a Qt C++ application as the writer and a Python script as the reader. Qt C++ Writer (SharedMemoryWriter) // main.cpp#include <QCoreApplication>#include <QSharedMemory>#include <QBuffer>#include <QDataStream>#include <QDebug>#include <QThread> int main(int argc, char *argv[]){ QCoreApplication a(argc, … Read more

FreeRTOS Queue Management

FreeRTOS Queue Management

Inter-Process Communication In bare-metal development, two applications typically use global variables for message passing. However, in applications using an operating system, using global variables for message passing involves “resource management” issues. FreeRTOS implements message passing between tasks and between tasks and interrupts through a mechanism called “queues”. Queue Management Queues generally use a first-in-first-out (FIFO) … Read more