예제 #1
0
ParallelFactory::ParallelFactory()
{
    // initialize default maximum number of threads
    _maxThreadCount = defaultThreadCount();

    // remember the current thread, and provide it with an index
    _parentThread = QThread::currentThread();
    addThreadIndex(_parentThread, 0);
}
예제 #2
0
void ThreadedDyscoColumn<DataType>::InitializeAfterNRowsPerBlockIsKnown()
{
	stopThreads();
	if(_bitsPerSymbol == 0)
		throw DyscoStManError("bitsPerSymbol not initialized in ThreadedDyscoColumn");
	
	_antennaCount = nAntennae();
	_blockSize = CalculateBlockSize(nRowsInBlock(), _antennaCount);
	_packedBlockReadBuffer.resize(_blockSize);
	const size_t nPolarizations = _shape[0], nChannels = _shape[1];
	_unpackedSymbolReadBuffer.resize(symbolCount(nRowsInBlock(), nPolarizations, nChannels));
	//TODO _timeBlockEncoder->SetNAntennae(_antennaCount);
	
	// start the threads
	size_t threadCount = defaultThreadCount();
	EncodingThreadFunctor functor;
	functor.parent = this;
	_stopThreads = false;
	for(size_t i=0;i!=threadCount;++i)
		_threadGroup.create_thread(functor);
}