/
dinruspro
/
tutorial
Обзор
Документация
Войти
/
dinruspro
/
tutorial
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
CoreTutorial/Parallel.cpp
22 строки
675 B
EnergonV
Уроки теперь тоже здесь!
09 янв 2024, 19:25
09 янв 2024, 19:25
4b3ebd6
Код
Авторство
О чём код?
#include "Tutorial.h" void CoAlgoTutorial() { /// .Parallel algorithms /// U++ provides a parallel versions of algorithms where it makes sense. The naming scheme /// is 'Co' prefix before the name of algorithm designates the parallel version. /// So the parallel version of e.g. `FindIndex` is `CoFindIndex`, for `Sort` it is `CoSort`: Vector<String> x{ "zero", "one", "two", "three", "four", "five" }; DUMP(FindIndex(x, "two")); DUMP(CoFindIndex(x, "two")); CoSort(x); DUMP(x); /// Caution should be exercised when using these algorithms - for small datasets, they are /// almost certainly slower than single-threaded versions. }