/
Snippet: Spawning Child Threads
Snippet: Spawning Child Threads
Prerequisites:
Process Parameters:
Parameter | Type | Prompt | Value |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Prolog (before Initialize Logging region)
pLogOutput = TRIM( pLogOutput );
nLogOutput = StringToNumber( If( pLogOutput @= '', '0', pLogOutput ));
Prolog (after trimming parameter values):
nMaxThreads = StringToNumber( If( pMaxThreads @= '', '0', pMaxThreads ));
nThreadID = StringToNumber( If( pThreadID @= '', '0', pThreadID ));
Prolog (declarations):
cCubParam = '}APQ Settings';
cDimPar = 'FIN Company';
cCubThreadCtrl = '}APQ C3 Thread Control';
cDimensionDelim = CellGetS( cCubParam, 'pDimDelim', 'String' );
cElementStartDelim = CellGetS( cCubParam, 'pEleStartDelim', 'String' );
cElementDelim = CellGetS( cCubParam, 'pEleDelim', 'String' );
cLogRecordThresholdRec = CellGetN( cCubParam, 'Progress logging threshold - number of records', 'Numeric' );
cLogRecordThresholdSec = CellGetN( cCubParam, 'Progress logging threshold - time', 'Numeric' );
cThreadPollingInterval = CellGetN( cCubParam, 'Thread polling interval (seconds)', 'Numeric' );
cMaxRunTime = CellGetN( cCubParam, 'Maximum run time allowed for parallel processing (seconds)', 'Numeric' );
cMaxInitTime = CellGetN( cCubParam, 'Maximum process initialization time allowed for parallel processing (seconds)', 'Numeric' );
cThreadMonitoringEnabled = 1;
If( cMaxRunTime <= 0 % cMaxRunTime > 0 & nMaxThreads = 1 );
cMaxRunTime = 0;
cThreadMonitoringEnabled = 0;
EndIf;
sMaxRunTime = NumberToString( cMaxRunTime );
Prolog (parameter testing region):
Prolog (after parameter testing region):
Prolog: