[cpp] Update READMEs for C++ projects and examples
This commit is contained in:
parent
34f12250ab
commit
6dbac7559a
|
@ -7,6 +7,7 @@ shaunrd0/klips/cpp/
|
||||||
├── cryptography # Examples of encrypting / decrypting using ciphers in C++
|
├── cryptography # Examples of encrypting / decrypting using ciphers in C++
|
||||||
├── datastructs # Collection of useful datastructures written in C++
|
├── datastructs # Collection of useful datastructures written in C++
|
||||||
├── graphics # Examples of graphics projects written in C++
|
├── graphics # Examples of graphics projects written in C++
|
||||||
|
├── multithreading # Basic multithreading examples in C++
|
||||||
├── patterns # Examples of various design patterns written in C++
|
├── patterns # Examples of various design patterns written in C++
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
|
@ -15,6 +15,9 @@ project(
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
add_compile_options("-Wall")
|
||||||
|
|
||||||
add_subdirectory(conditions)
|
add_subdirectory(conditions)
|
||||||
add_subdirectory(deadlock)
|
add_subdirectory(deadlock)
|
||||||
add_subdirectory(livelock)
|
add_subdirectory(livelock)
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Multithreading
|
||||||
|
|
||||||
|
A few basic multithreading programs written in C++ while learning about
|
||||||
|
the [concurrency support library](https://en.cppreference.com/w/cpp/thread)
|
||||||
|
|
||||||
|
```
|
||||||
|
klips/cpp/multithreading
|
||||||
|
.
|
||||||
|
├── conditions # Using condition_variable to control job execution flow
|
||||||
|
├── deadlock # Example of problem and solution for deadlocks
|
||||||
|
├── livelock # Example of problem and solution for livelocks
|
||||||
|
├── race-condition # Example of problem and solution for race conditions
|
||||||
|
└── README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
We can build the examples with the following commands.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /path/to/klips/cpp/multithreading/
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake .. && cmake --build .
|
||||||
|
ls bin/
|
||||||
|
|
||||||
|
multithread-conditions multithread-deadlock multithread-livelock multithread-race-condition
|
||||||
|
```
|
Loading…
Reference in New Issue