当前位置: 首页>>代码示例>>C++>>正文


C++ ThreadPool::addThread方法代码示例

本文整理汇总了C++中ThreadPool::addThread方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadPool::addThread方法的具体用法?C++ ThreadPool::addThread怎么用?C++ ThreadPool::addThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThreadPool的用法示例。


在下文中一共展示了ThreadPool::addThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
	GenomeCopyNumber sampleCopyNumber;
	sampleCopyNumber.setSamtools(pathToSamtools);

	GenomeCopyNumber controlCopyNumber;
	controlCopyNumber.setSamtools(pathToSamtools);

	SNPinGenome snpingenome;
	SNPinGenome snpingenomeControl;

string myNametmp = myName;
string myRealName;
int i = 0;
while ((myName[myName.size()-i]) != '/')
    {
    if (myNametmp[myNametmp.size()-i] != ' ')
        {myRealName.push_back(myNametmp[myNametmp.size()-i]);}
    i++;
    }
myRealName = string(myRealName.rbegin(), myRealName.rend());

	ThreadPoolManager* thrPoolManager = ThreadPoolManager::getInstance();
	ThreadPool* thrPool = NULL;
	if (has_BAF) {  //read the pileup files only once
	  GenomeCopyNumberReadMateFileArgWrapper* readMateFileArg;

	  cout << "..will use SNP positions from "<< SNPinfoFile << " to calculate BAF profiles\n";
	  thrPool = thrPoolManager->newThreadPool("GenomeCopyNumber_readMateFile");

	  snpingenome.readSNPs(SNPinfoFile);

	  if (is_sample_pileup && !has_sample_mateCopyNumberFile && has_window) {
		std::cout << "avoid double pileup read: reading sample matefile\n";
		readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenome, sample_MateFile, sample_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, sampleCopyNumber, chrLenFile, window, step);
		thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
		sample_copyNumber_pileup_read = true;
	  } else {
		readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenome, sample_MateFile, sample_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition);
		thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
		sample_copyNumber_pileup_read = false;
	  }

	  if (isControlIsPresent) {
		snpingenomeControl.setSNPChr(snpingenome.getSNPChr());

		if (is_control_pileup && !has_control_mateCopyNumberFile && has_window) {
		  std::cout << "avoid double pileup read: reading control matefile\n";
		  readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenomeControl, control_MateFile, control_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, controlCopyNumber, chrLenFile, window, step);
		  thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
		  control_copyNumber_pileup_read = true;
		} else {
		  readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenomeControl, control_MateFile, control_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition);
		  thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
		  control_copyNumber_pileup_read = false;
		}
	  }
      thrPool->run();
      delete thrPool;

	}


    if((ifTargeted) && (window == 0) && (step == 0))
       {
       cout << "FREEC will work on exome sequencing data! \n";
       if (has_sample_mateCopyNumberFile) {
            sampleCopyNumber.readCopyNumber(sample_MateCopyNumberFile);
开发者ID:gurjaolab,项目名称:FREEC_7.4,代码行数:67,代码来源:main.cpp


注:本文中的ThreadPool::addThread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。