merged AI doc, some new pages

This commit is contained in:
2026-03-12 14:46:57 +03:00
parent 07ae277f9e
commit ed13838237
206 changed files with 14088 additions and 5152 deletions

View File

@@ -1,9 +1,8 @@
/*! \file pithreadpoolloop.h
* \ingroup Thread
* \~\brief
* \~english Thread pool loop
* \~russian Пул потоков
*/
//! \~\file pithreadpoolloop.h
//! \~\ingroup Thread
//! \~\brief
//! \~english Parallel loop helper
//! \~russian Вспомогательный класс для параллельного цикла
/*
PIP - Platform Independent Primitives
Thread pool loop
@@ -31,54 +30,44 @@
class PIThread;
//! \~\ingroup Thread
//! \~\brief
//! \~english Helper that runs one integer range across a fixed set of worker threads.
//! \~russian Вспомогательный класс, который выполняет один целочисленный диапазон на фиксированном наборе рабочих потоков.
class PIP_EXPORT PIThreadPoolLoop {
public:
//! \~english
//! Contructs thread pool with threads count "thread_cnt".
//! If "thread_cnt" = -1 then system processors count used
//! \~russian
//! Создает пул из "thread_cnt" потоков. Если "thread_cnt" = -1
//! то используется количество процессоров системы
//! \~english Constructs parallel loop runner with \a thread_cnt worker threads. If \a thread_cnt is less than or equal to zero, the
//! processor count is used.
//! \~russian Создает исполнитель параллельного цикла с \a thread_cnt рабочими потоками. Если \a thread_cnt меньше либо равен нулю,
//! используется количество процессоров.
PIThreadPoolLoop(int thread_cnt = -1);
//! \~english Stops worker threads and destroys the loop runner.
//! \~russian Останавливает рабочие потоки и уничтожает исполнитель цикла.
virtual ~PIThreadPoolLoop();
//! \~english Set threads function to [lambda expression](https://en.cppreference.com/w/cpp/language/lambda) "f" with format [ ](int){
//! ... }
//! \~russian Устанавливает функцию потоков на [лямбда-выражение](https://ru.cppreference.com/w/cpp/language/lambda) "f" в формате [
//! ](int){ ... }
//! \~english Sets the iteration body called once for each index of a started range.
//! \~russian Устанавливает тело итерации, которое вызывается один раз для каждого индекса запущенного диапазона.
void setFunction(std::function<void(int)> f);
//! \~english Wait for all threads stop
//! \~russian Ожидает завершения всех потоков
//! \~english Waits for the current in-flight batch started by \a start().
//! \~russian Ожидает завершения текущего запущенного пакета, начатого через \a start().
void wait();
//! \~english
//! Start functions execution with integer argument range
//! from "index_start" to "index_start + index_count - 1"
//! \~russian
//! Начинает исполнение потоков с аргументами по диапазону
//! от "index_start" до "index_start + index_count - 1"
//! \~english Starts asynchronous execution for indices in range [\a index_start, \a index_start + \a index_count).
//! \~russian Запускает асинхронное выполнение для индексов из диапазона [\a index_start, \a index_start + \a index_count).
void start(int index_start, int index_count);
//! \~english
//! Start functions execution with integer argument range
//! from "index_start" to "index_start + index_count - 1"
//! and wait for finish
//! \~russian
//! Начинает исполнение потоков с аргументами по диапазону
//! от "index_start" до "index_start + index_count - 1"
//! и ожидает завершения
//! \~english Runs the configured iteration body for indices in range [\a index_start, \a index_start + \a index_count) and waits for
//! completion.
//! \~russian Выполняет настроенное тело итерации для индексов из диапазона [\a index_start, \a index_start + \a index_count) и ожидает
//! завершения.
void exec(int index_start, int index_count);
//! \~english
//! Start functions "f" execution with integer argument range
//! from "index_start" to "index_start + index_count - 1"
//! and wait for finish
//! \~russian
//! Начинает исполнение потоками функции "f" с аргументами по диапазону
//! от "index_start" до "index_start + index_count - 1"
//! и ожидает завершения
//! \~english Sets iteration body to \a f, runs it for indices in range [\a index_start, \a index_start + \a index_count), and waits for
//! completion.
//! \~russian Устанавливает тело итерации \a f, выполняет его для индексов из диапазона [\a index_start, \a index_start + \a
//! index_count) и ожидает завершения.
void exec(int index_start, int index_count, std::function<void(int)> f);
private: