The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MultiThreadParallel Class Reference

#include <MultiThreadParallel.hpp>

Inheritance diagram for MultiThreadParallel:
Inheritance graph
[legend]

Public Member Functions

 ~MultiThreadParallel ()
 
void call (size_t maxIndex, std::function< void(size_t firstIndex, size_t numIndices)> target) override
 
- Public Member Functions inherited from Parallel
virtual ~Parallel ()
 
virtual void call (size_t maxIndex, std::function< void(size_t firstIndex, size_t numIndices)> target)=0
 

Protected Member Functions

bool doSomeWork () override
 
- Protected Member Functions inherited from MultiParallel
void activateThreads ()
 
void constructThreads (int numThreads)
 
void destroyThreads ()
 
int numThreads ()
 
void waitForThreads ()
 
- Protected Member Functions inherited from Parallel
 Parallel ()
 

Private Member Functions

 MultiThreadParallel (int threadCount)
 

Private Attributes

ChunkMaker _chunkMaker
 
std::function< void(size_t, size_t)> _target
 

Friends

class ParallelFactory
 

Detailed Description

This class implements the Parallel base class interface using multiple execution threads in a single process. It uses the facilities offered by the MultiParallel base class.

Constructor & Destructor Documentation

◆ MultiThreadParallel()

MultiThreadParallel::MultiThreadParallel ( int  threadCount)
explicitprivate

Constructs a MultiThreadParallel instance with the specified number of execution threads. The constructor is private; use the ParallelFactory::parallel() function instead.

◆ ~MultiThreadParallel()

MultiThreadParallel::~MultiThreadParallel ( )

Destructs the instance and its parallel threads.

Member Function Documentation

◆ call()

void MultiThreadParallel::call ( size_t  maxIndex,
std::function< void(size_t firstIndex, size_t numIndices)>  target 
)
overridevirtual

This function implements the call() interface described in the Parallel base class for the parallelization scheme offered by this subclass.

Implements Parallel.

◆ doSomeWork()

bool MultiThreadParallel::doSomeWork ( )
overrideprotectedvirtual

The function to do the actual work, one chunk at a time.

Implements MultiParallel.


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