31 explicit ProcHandler(
unsigned int nWorkerProc,
bool markChildrenAsLocal =
false);
A class to manage processes for parallel processing.
void startOutputProcess()
There is no real output process, but marks current process as output.
static bool isWorkerProcess()
Return true if the process is a worker process.
static int EvtProcID()
Return ID of the current process.
std::set< int > m_processList
PIDs of processes controlled by this ProcHandler.
static int numEventProcesses()
Return number of worker processes (configured value, not current)
static bool isOutputProcess()
Return true if the process is an output process.
static bool isInputProcess()
Return true if the process is an input process.
static void setProcessID(int processID)
Set the process ID of this process.
unsigned int m_numWorkerProcesses
Number of worker processes controlled by this ProcHandler.
static std::set< int > globalProcessList()
Return list of all PIDs (from all ProcHandler instances).
bool waitForAllProcesses()
Wait until all forked processes handled by this ProcHandler terminate.
static bool parallelProcessingUsed()
Returns true if multiple processes have been spawned, false in single-core mode.
bool m_markChildrenAsLocal
Anormal termination of child will not stop parent, waitForAllProcesses() returns status.
bool startProc(std::set< int > *processList, const std::string &procType, int id)
Start a new process, adding its PID to processList, and setting s_processID = id.
~ProcHandler()
Destructor.
void startWorkerProcesses()
Fork and initialize worker processes.
std::set< int > processList() const
Return list of PIDs managed by this ProcHandler instance.
void startInputProcess()
Fork and initialize an input process.
static std::string getProcessName()
Get a name for this process.
Abstract base class for different kinds of events.