PCL
pcl::ParallelProcess Class Reference

A process using multiple concurrent execution threads. More...

#include <ParallelProcess.h>

+ Inheritance diagram for pcl::ParallelProcess:

Public Member Functions

 ParallelProcess ()=default
 
 ParallelProcess (const ParallelProcess &)=default
 
virtual ~ParallelProcess ()
 
void DisableParallelProcessing (bool disable=true) noexcept
 
void EnableParallelProcessing (bool enable=true, int maxProcessors=0) noexcept
 
bool IsParallelProcessingEnabled () const noexcept
 
int MaxProcessors () const noexcept
 
ParallelProcessoperator= (const ParallelProcess &)=default
 
void SetMaxProcessors (int maxProcessors) noexcept
 
void Swap (ParallelProcess &process) noexcept
 

Detailed Description

ParallelProcess is a base class for classes implementing multithreaded processes in PCL.

Definition at line 72 of file ParallelProcess.h.

Constructor & Destructor Documentation

◆ ParallelProcess() [1/2]

pcl::ParallelProcess::ParallelProcess ( )
default

Default constructor.

By default, parallel processing is always enabled, and any process can use the maximum possible number of parallel execution threads.

◆ ParallelProcess() [2/2]

pcl::ParallelProcess::ParallelProcess ( const ParallelProcess )
default

Copy constructor.

◆ ~ParallelProcess()

virtual pcl::ParallelProcess::~ParallelProcess ( )
inlinevirtual

Virtual destructor.

Definition at line 92 of file ParallelProcess.h.

Member Function Documentation

◆ DisableParallelProcessing()

void pcl::ParallelProcess::DisableParallelProcessing ( bool  disable = true)
inlinenoexcept

Disables parallel processing for this process.

This is a convenience function, equivalent to:

Definition at line 135 of file ParallelProcess.h.

◆ EnableParallelProcessing()

void pcl::ParallelProcess::EnableParallelProcessing ( bool  enable = true,
int  maxProcessors = 0 
)
inlinenoexcept

Enables parallel processing for this process.

Parameters
enableWhether to enable or disable parallel processing. True by default.
maxProcessorsThe maximum number of processors allowed for this instance. If enable is false this parameter is ignored. A value ≤ 0 is ignored. The default value is zero.

Definition at line 120 of file ParallelProcess.h.

◆ IsParallelProcessingEnabled()

bool pcl::ParallelProcess::IsParallelProcessingEnabled ( ) const
inlinenoexcept

Returns true iff this process is allowed to use multiple parallel execution threads, when multiple threads are permitted and available.

Definition at line 105 of file ParallelProcess.h.

◆ MaxProcessors()

int pcl::ParallelProcess::MaxProcessors ( ) const
inlinenoexcept

Returns the maximum number of processors allowed for this process.

Irrespective of the value returned by this function, a module should not use more processors than the maximum number of parallel threads allowed for external modules on the PixInsight platform. This number is given by the "Process/MaxProcessors" global variable. Refer to the GlobalSettings class for information on global variables.

Definition at line 149 of file ParallelProcess.h.

◆ operator=()

ParallelProcess& pcl::ParallelProcess::operator= ( const ParallelProcess )
default

Copy assignment operator. Returns a reference to this object.

◆ SetMaxProcessors()

void pcl::ParallelProcess::SetMaxProcessors ( int  maxProcessors)
inlinenoexcept

Sets the maximum number of processors allowed for this process.

A value of maxProcessors ≤ 0 is ignored and causes the call to this function to have no effect.

In the current version of PCL, a module can use a maximum of 1023 processors. The term processors actually refers to the number of threads a module can execute concurrently.

Irrespective of the value specified by this function, a module should not use more processors than the maximum number of parallel threads allowed for external modules on the PixInsight platform. This number is given by the "Process/MaxProcessors" global variable. Refer to the GlobalSettings class for information on global variables.

Definition at line 170 of file ParallelProcess.h.

◆ Swap()

void pcl::ParallelProcess::Swap ( ParallelProcess process)
inlinenoexcept

Exchanges two ParallelProcess instances.

Definition at line 179 of file ParallelProcess.h.

References pcl::Swap().


The documentation for this class was generated from the following file:
pcl::ParallelProcess::EnableParallelProcessing
void EnableParallelProcessing(bool enable=true, int maxProcessors=0) noexcept
Definition: ParallelProcess.h:120