[#llvm-ThreadPoolStrategy] = xref:llvm.adoc[llvm]::ThreadPoolStrategy :relfileprefix: ../ :mrdocs: This tells how a thread pool will be used == Synopsis Declared in `<llvm/Support/Threading.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ThreadPoolStrategy; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/ThreadPoolStrategy/apply_thread_strategy.adoc[`apply_thread_strategy`] | Assign the current thread to an ideal hardware CPU or NUMA node. | xref:llvm/ThreadPoolStrategy/compute_cpu_socket.adoc[`compute_cpu_socket`] | Finds the CPU socket where a thread should go. Returns 'std::nullopt' if the thread shall remain on the actual CPU socket. | xref:llvm/ThreadPoolStrategy/compute_thread_count.adoc[`compute_thread_count`] | Retrieves the max available threads for the current strategy. This accounts for affinity masks and takes advantage of all CPU sockets. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:llvm/ThreadPoolStrategy/Limit.adoc[`Limit`] | When true, clamp ThreadsRequested to hardware thread or core counts. | xref:llvm/ThreadPoolStrategy/ThreadsRequested.adoc[`ThreadsRequested`] | Suggested upper bound on worker threads; 0 means use all available. | xref:llvm/ThreadPoolStrategy/UseHyperThreads.adoc[`UseHyperThreads`] | If SMT is active, use hyper threads; otherwise one std::thread per core. | xref:llvm/ThreadPoolStrategy/UseJobserver.adoc[`UseJobserver`] | When true, coordinate with a GNU Make jobserver if one is present. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/get_threadpool_strategy.adoc[`get_threadpool_strategy`] | Build a strategy from a number of threads as a string provided in `Num.` | xref:llvm/hardware_concurrency-03.adoc[`hardware_concurrency`] | Parse `Num` into a hardware_concurrency strategy. | xref:llvm/hardware_concurrency-09.adoc[`hardware_concurrency`] | Use all available hardware threads, honoring affinity masks. | xref:llvm/heavyweight_hardware_concurrency-01.adoc[`heavyweight_hardware_concurrency`] | Build a strategy that prefers physical cores over SMT. | xref:llvm/heavyweight_hardware_concurrency-08.adoc[`heavyweight_hardware_concurrency`] | Parse `Num` into a heavyweight_hardware_concurrency strategy. | xref:llvm/jobserver_concurrency.adoc[`jobserver_concurrency`] | Coordinate with a GNU Make jobserver when one is present. | xref:llvm/optimal_concurrency.adoc[`optimal_concurrency`] | Limit threads to about `TaskCount` so small jobs avoid oversubscription. | xref:llvm/lto/createInProcessThinBackend.adoc[`lto::createInProcessThinBackend`] | Create a ThinBackend that runs individual jobs in‐process. | xref:llvm/lto/createWriteIndexesThinBackend.adoc[`lto::createWriteIndexesThinBackend`] | Create a ThinBackend that writes module indexes for distributed builds. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#