MCPcopy Create free account
hub / github.com/DmitriBogdanov/UTL / main

Function main

examples/module_parallel/using_a_local_thread_pool.cpp:5–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <iostream>
4
5int main() {
6 using namespace utl;
7
8 parallel::ThreadPool pool; // uses as many threads as it detects
9
10 pool.detached_task([]{ std::cout << "Hello from the task\n"; });
11
12 pool.set_thread_count(0); // will wait for the tasks, join all threads and release the memory
13}

Callers

nothing calls this directly

Calls 2

detached_taskMethod · 0.45
set_thread_countMethod · 0.45

Tested by

no test coverage detected