You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
632 B

2 years ago
# Inter-thread Communication Benchmark
This code tests the best way to collaborate between threads
## Platform tested:
2 years ago
- Windows (MSVC, gcc-12.2, WSL-gcc11.2, WSL-clang-14)
- macOS (clang-13, gcc-12.2)
- Linux (gcc-12.1, gcc-11.3, clang-12)
- arm64 Linux (gcc-12.1, clang-12)
## Method tested:
2 years ago
- C++20 std::semaphores
- Native semaphores
- Condition Variables
- Busy waiting (spinlock) with or without delay
## Results:
```
2 years ago
macOS linux win, msc win, gcc
cv 6000 10000 700 26000
busy 360 300 550 300
nsmph 600 4418 6000 1200
smph 240 1000/dl 660 dl
```
2 years ago
Bug on g++ 12.2.0 might cause deadlock, see: gcc12.2.0deadlockbug.cpp