Lightweight workload-aware policy for deciding whether an internal phase should actually launch parallel work when parallel mode is allowed.
More...
#include <BRepGraph_ParallelPolicy.hxx>
|
| static int | WorkerCount () |
| | Return the effective logical worker count reported by OSD_Parallel.
|
| static bool | IsParallelAllowed (const bool theAllowParallel) |
| | Check whether parallel execution is allowed and meaningful at all.
|
| static bool | ShouldRun (const bool theAllowParallel, const int theWorkers, const Workload &theWorkload) |
| | Decide whether the estimated workload is large enough to amortize thread-pool launch and synchronization overhead.
|
| static bool | ShouldRun (const bool theAllowParallel, const Workload &theWorkload) |
| | Overload that queries the active worker count lazily.
|
Lightweight workload-aware policy for deciding whether an internal phase should actually launch parallel work when parallel mode is allowed.
The goal is to avoid forcing every short-lived loop onto the thread pool. Decisions are based on available worker capacity and on the amount of work already visible to the phase, instead of on buried per-loop split sizes.
◆ IsParallelAllowed()
| bool BRepGraph_ParallelPolicy::IsParallelAllowed |
( |
const bool | theAllowParallel | ) |
|
|
inlinestaticnodiscard |
Check whether parallel execution is allowed and meaningful at all.
◆ ShouldRun() [1/2]
| bool BRepGraph_ParallelPolicy::ShouldRun |
( |
const bool | theAllowParallel, |
|
|
const int | theWorkers, |
|
|
const Workload & | theWorkload ) |
|
staticnodiscard |
Decide whether the estimated workload is large enough to amortize thread-pool launch and synchronization overhead.
- Parameters
-
| [in] | theAllowParallel | whether parallel mode is allowed by the caller |
| [in] | theWorkers | effective logical worker count |
| [in] | theWorkload | estimated workload for the phase |
- Returns
- true if parallel execution should be used
◆ ShouldRun() [2/2]
| bool BRepGraph_ParallelPolicy::ShouldRun |
( |
const bool | theAllowParallel, |
|
|
const Workload & | theWorkload ) |
|
inlinestaticnodiscard |
Overload that queries the active worker count lazily.
- Parameters
-
| [in] | theAllowParallel | whether parallel mode is allowed by the caller |
| [in] | theWorkload | estimated workload for the phase |
- Returns
- true if parallel execution should be used
◆ WorkerCount()
| int BRepGraph_ParallelPolicy::WorkerCount |
( |
| ) |
|
|
inlinestaticnodiscard |
Return the effective logical worker count reported by OSD_Parallel.
The documentation for this class was generated from the following file: