Rico's Nerd Cluster

「离开世界之前 一切都是过程」

C++ - [Concurrency 3] Memory Model

Introduction The C++ memory model was formally introduced in C++11 mainly for multithreading. Before C++11: Threading was platform-dependent. (POSIX threads for Unit systems) Behavior of sh...

C++ - [Concurrency 2] Coroutine

Coroutine Coroutines in C++ allows us to write asynchronous code in a sequential style. It allows us to resume and suspend, instead of blocking a thread. A coroutine by default is single-threaded,...

C++ - [Concurrency 1] Various Concurrent Methods

Asynchonous Programming, Vectorization, `std::launch`, Lockless array writes, OpenMP, SIMD

Asynchronous Programming Single-Threaded Asynchornous Programming Cooperative Multitasking & Pre-emptive Multitasking This is a model where each task voluntari...

C++ - Language Properties

Zero-Overhead Abstraction, Garbage-Collection-Free, Endianness Handling, One-Definition-Rule (ODR)

C++ and C are known for their high performance. High level languages like Python are known for their relative ease of use. In this article, we will compare the two sides and see what makes C++ spec...

C++ - Coding Styles

Casing

Casing namespace: lower case like std, boost.

C++ - Functions, Lambda

Lambda, Functors, Function Pointer

Functor A functor is an object that acts like a function, using the overloaded operator(). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 struct greaters{ greaters(){} operator()(int a, int b){retur...

C++ - Templates

Class Templates, Dependent Name Lookup, Non-Type Template Parameters, requires, concept

Class Template Be careful with nested class inside a class template - we need to specify the template parameters here as well. 1 2 3 4 5 6 7 8 9 10 11 template <typename T> class A{ pub...

C++ - Static Functions And Keyword

Static Functions And Keyword

As a very high level summary, the keyword static has two uses: File scope static variables and functions can be only accessed within the current translation unit (i.e., the cpp source file) C...

C++ - Enum

Static Functions And Keyword

Enum Class Enum class is a type safe way to initialize enums. It’s called “scoped enum”, which is an integral type under the hood. They do not implicitly convert to int or any other type to enforc...

Common Robotics CPP Software Packages

TBB

TBB TBB (Intel Threading Building Blocks) is a parallel-programming library that abstracts out details for managing threads, synchronization, or load balancing explicitly. Key features include: ...