Skip to content

Instantly share code, notes, and snippets.

View CaglayanDokme's full-sized avatar
🦅

Caglayan DOKME CaglayanDokme

🦅
View GitHub Profile
@CaglayanDokme
CaglayanDokme / ThreadSafeMsgQueue.md
Created September 16, 2023 09:13
Thread Safe Template Message Queue in C++17

Implementing a thread-safe message queue is crucial in concurrent and multi-threaded programming to facilitate safe communication between threads. A thread-safe message queue ensures that multiple threads can share data without running into issues such as data races, deadlocks, or data corruption. By using synchronization mechanisms like mutexes and condition variables, a thread-safe message queue provides a structured and controlled environment for threads to exchange information. Additionally, designing the message queue as a template, as seen in the provided MsgQueue class, adds a layer of flexibility and adaptability. It allows developers to use the same message queue implementation for a wide range of data types, making it a versatile tool in various applications. This template-based approach promotes code reuse, reducing the need to create specialized message queue classes for different data types and enhancing the overall efficiency and maintainability of concurrent software systems.

#pragma 

Checksum Calculation for MIL-STD-1760 in C++

MIL-STD-1760, short for Military Standard 1760, is a widely recognized and utilized interface standard within the aerospace and defense industries. This standard defines crucial protocols for data transmission between aircraft and munitions. One such protocol is the use of checksums, which play a vital role in ensuring the integrity of data during transmission.

In the context of MIL-STD-1760, a checksum acts as a digital fingerprint for the transmitted data. Its primary purpose is to detect any potential errors, corruption, or tampering that might occur during transmission. This is especially important to prevent disastrous consequences in mission-critical scenarios. Essentially, the checksum serves as a verification mechanism that allows the receiving end to confirm whether the received data matches what was initially sent by the transmitting end.

At first encounter, the documentation of th

Is there an ultimate Makefile?: Part 2 - Libraries

Welcome to the second part of our Makefile series, where we migrate your build system to a more modular structure by including your very own libraries. In the previous article, we covered the fundamentals of creating a powerful Makefile, including directory structure, variable definition, target dependencies, and more. Now, we'll dive deeper into the realm of user-defined libraries, allowing you to unlock the full potential of your Makefile automation. By leveraging static libraries, you can enhance the modularity and reusability of your code, making it easier to manage dependencies and accelerate your development workflow. In this article, we'll walk you through the process of creating and utilizing user-defined static libraries within your Makefile, providing you with the tools to supercharge your C++ projects.

Who is this article for?

  • If you have a GNU Linux development environm

Is there an ultimate Makefile?: Part 1 - Applications

Have you ever struggled with writing your Makefile manually or dealing with your projects without depending on a specific IDE? If so, this article is for you to break your chains.

Picture this: a Makefile that adapts to your project like a chameleon, requiring only a few parameter tweaks to fit most of your needs. Gone are the days of wrestling with convoluted build scripts or spending hours integrating external libraries. With this Makefile in your arsenal, you'll conquer the build process with ease and finesse.

Who is this article for?

  • If you have a GNU Linux development environment.
  • If you are using GNU compilers such as g++.
  • If you don't depend on any IDE for project configurations.