Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Static Public Member Functions
BRepGraph_ParallelPolicy Class Reference

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>

Data Structures

struct  Workload
 Simple workload estimate for an execution phase. More...
 

Static Public Member Functions

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.
 

Detailed Description

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.

Member Function Documentation

◆ IsParallelAllowed()

static bool BRepGraph_ParallelPolicy::IsParallelAllowed ( const bool theAllowParallel)
inlinestatic

Check whether parallel execution is allowed and meaningful at all.

◆ ShouldRun() [1/2]

static bool BRepGraph_ParallelPolicy::ShouldRun ( const bool theAllowParallel,
const int theWorkers,
const Workload & theWorkload )
inlinestatic

Decide whether the estimated workload is large enough to amortize thread-pool launch and synchronization overhead.

◆ ShouldRun() [2/2]

static bool BRepGraph_ParallelPolicy::ShouldRun ( const bool theAllowParallel,
const Workload & theWorkload )
inlinestatic

Overload that queries the active worker count lazily.

◆ WorkerCount()

static int BRepGraph_ParallelPolicy::WorkerCount ( )
inlinestatic

Return the effective logical worker count reported by OSD_Parallel.


The documentation for this class was generated from the following file: