/
LavrGov
/
thread_pool
Обзор
Документация
Войти
/
LavrGov
/
thread_pool
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
cpp_pool/main.cpp
23 строки
377 B
Lavrentiy
Realizing your own simple thread pool in c++ and rust
08 май 2025, 22:19
08 май 2025, 22:19
0fc8cf1
Код
Авторство
О чём код?
#include <iostream> #include "thread_pool/thread_pool.hpp" #include <chrono> using namespace std::chrono_literals; int main() { ThreadPool pool = {4}; int test_data = 0; for (size_t i = 0; i < 1000000; i ++) { pool.Submit([&]() { ++test_data; }); } pool.join(); std::cout << test_data << std::endl; //std::cout << "Hello, world" << std::endl; return 0; }