Class SampleGroupProcessorMultithread

Inheritance Relationships

Base Type

Class Documentation

class SampleGroupProcessorMultithread : public SmartPeak::ProcessorMultithread

Processes Sample Group onto multiple threads of execution

Public Functions

inline SampleGroupProcessorMultithread(std::vector<SampleGroupHandler> &sequenceSegmentHandler_IO, SequenceHandler &sequenceHandler_I, std::vector<std::shared_ptr<SampleGroupProcessor>> &sample_group_processing_methods, std::map<std::string, Filenames> &filenames, SampleGroupProcessorObservable *observable = nullptr)
void spawn_workers(unsigned int n_threads)

Spawn a number of workers equal to the number of threads of execution offered by the CPU

Note

If the API is unable to fetch the required information, only a single thread will be used

virtual void run_processing()

Workers run this function. It implements a loop that runs the following steps:

  • fetch sequence segments

  • process all methods on it

Workers decide on which sequence segment to work according to an index fetched and incremented atomically (i_).

The loop ends when the worker fetches an index that is out of range.