This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef SHARED_MUTEX_H | |
| #define SHARED_MUTEX_H | |
| #include <pthread.h> | |
| #include <stdatomic.h> | |
| // 共有メモリに配置する構造体 | |
| typedef struct { | |
| pthread_mutex_t mutex; // プロセス間で共有される堅牢なミューテックス | |
| atomic_uint ref_count; // 参照カウンタ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cobalt@teto⮀~⮀⮀ | |
| ⮁⮁⮁ sudo perf bench mem memcpy -s 2GB -l 10 | |
| # Running 'mem/memcpy' benchmark: | |
| # function 'default' (Default memcpy() provided by glibc) | |
| # Copying 2GB bytes ... | |
| 26.870777 GB/sec | |
| # function 'x86-64-unrolled' (unrolled memcpy() in arch/x86/lib/memcpy_64.S) | |
| # Copying 2GB bytes ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <chrono> | |
| #include <condition_variable> | |
| #include <cstdint> | |
| #include <iostream> | |
| #include <mutex> | |
| #include <stop_token> | |
| #include <thread> | |
| auto main() -> int32_t { | |
| std::mutex mut; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.22) | |
| project(opencv_builder) | |
| set(OPENCV_VERSION "4.11.0") | |
| string(TOLOWER ${CMAKE_SYSTEM_NAME} lower_system_name) | |
| string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} lower_system_processor) | |
| set(CMAKE_TOOLCHAIN_FILE OFF) | |
| set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install/opencv-${OPENCV_VERSION}-${lower_system_name}-${lower_system_processor}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdint> | |
| #include <print> | |
| #include <string_view> | |
| class A { | |
| public: | |
| static constexpr const char* Key1 = "Key1"; | |
| static inline const char* Key2 = "Key2"; | |
| static inline const char* const Key3 = "Key3"; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd $(git rev-parse --show-toplevel) | (cd build && ninja -t deps) | grep -E "^[ \t]" | grep -E "\.(cc|cpp|cxx|h|hpp|inl)$" | awk '!a[$0]++{print $0}' | sed -e "s/^[ \t]*//" -e "s@$(git rev-parse --show-toplevel)/@@g" | zip archive.zip -@ |
OlderNewer