C++17: Efficiently Returning std::vector from Functions

The discussion centers on returning std::vector from C++ functions, highlighting Return Value Optimization (RVO) introduced in C++17. RVO allows the compiler to avoid copying vectors by constructing them in place when there's a single return path. For multiple return paths, std::move is used to transfer ownership efficiently. Exceptions exist, particularly with the conditional operator, which requires copying. Returning references from member functions is safer than from free functions since the object's lifetime ensures validity.

When std::shared_mutex Outperforms std::mutex: A Google Benchmark Study

In multi-threaded programming, protecting shared resources is crucial. std::mutex is common, but may bottleneck performance when many readers access data. std::shared_mutex can optimize scenarios with many readers and few writers, though its advantages depend on thread concurrency. Understanding the workload's read/write balance is key for effective synchronization.

Step-by-Step Guide: Filezilla Setup for AWS EC2

Recently I have been involved in doing to some source code compilation on an AWS EC2 instance. However, after the compilation I encountered a problem.…

Continue reading → Step-by-Step Guide: Filezilla Setup for AWS EC2

Resolving GobiSerial Module Errors on Raspberry Pi

Encountering 'Unknown Symbol' errors while loading the GobiSerial module on Raspberry Pi? This in-depth guide walks you through debugging missing kernel symbols, manually loading required modules, and properly configuring dependencies using depmod and modprobe for a clean and persistent fix. Learn how to resolve LTE driver issues with Sierra Wireless EM7565 on RPi effortlessly!

How to integrate a custom device driver into nuttx tree

I had written a blog on how to integrate a custom driver into Linux kernel tree previously here. Integrating a custom driver in nuttx kernel is pretty similar. But writing this down would probably be a good idea for any future reference.

How to create and run cppcheck executable from source code in linux machine (C++11 Static Analysis)

I do not have administrative rights on a linux server (openSuse Linux) I am working on right now. So installing anything is not an option…

Continue reading → How to create and run cppcheck executable from source code in linux machine (C++11 Static Analysis)

How to run an external program from a python script

This is a demonstration how a python script can be used to automate the running of an external program which takes data file as input. The data file can be spread over differnet folders in the machine. The script goes to the data file location, extracts the name of each file in the folder and then passes the data file to the external binary.