From a839c7dc3e3d5fc57bd5253661841686cbbfda65 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 5 Oct 2022 11:47:24 +0200 Subject: [PATCH] remove shared counter --- main.cpp | 2 -- start_main.cpp | 2 -- ws-ipc/README.md | 6 ++++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 318dcfe..53eac6c 100644 --- a/main.cpp +++ b/main.cpp @@ -2,8 +2,6 @@ using namespace std; -static uint32_t SHARED_COUNTER = 0; - int main() { cout << "Hello World" << endl; } diff --git a/start_main.cpp b/start_main.cpp index 318dcfe..53eac6c 100644 --- a/start_main.cpp +++ b/start_main.cpp @@ -2,8 +2,6 @@ using namespace std; -static uint32_t SHARED_COUNTER = 0; - int main() { cout << "Hello World" << endl; } diff --git a/ws-ipc/README.md b/ws-ipc/README.md index fdc5399..6ccf759 100644 --- a/ws-ipc/README.md +++ b/ws-ipc/README.md @@ -23,3 +23,9 @@ if you are completely new to concurrency in C++. is protected by a [`std::mutex`](https://en.cppreference.com/w/cpp/thread/mutex). You can also use the [`std::lock_guard`](https://en.cppreference.com/w/cpp/thread/lock_guard) which is a [RAII-style](https://en.cppreference.com/w/cpp/language/raii) helper object. + +# 2. Using messages + +C++ does not really have an built-in message queue implementation. +We are going to use a `std::queue` in conjunction with a `std::mutex` to +have something similar to a message queue API.