本文整理汇总了C++中JobQueue::enqueue方法的典型用法代码示例。如果您正苦于以下问题:C++ JobQueue::enqueue方法的具体用法?C++ JobQueue::enqueue怎么用?C++ JobQueue::enqueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobQueue
的用法示例。
在下文中一共展示了JobQueue::enqueue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static inline void
enqueueStandardSplittingJob(JobQueue& jobQueue, const LcpCacheStringPtr* inputs, unsigned numInputs, string* output, size_t jobLength)
{
if (numInputs == 1)
jobQueue.enqueue(new CopyDataJob(inputs[0], output));
else if (numInputs <= 2)
jobQueue.enqueue(new BinaryMergeJob(inputs[0], inputs[1], 0, output));
else if (numInputs <= 4)
jobQueue.enqueue(new MergeJobStandardSplitting<4>(inputs, numInputs, output, jobLength));
else if (numInputs <= 8)
jobQueue.enqueue(new MergeJobStandardSplitting<8>(inputs, numInputs, output, jobLength));
else if (numInputs <= 16)
jobQueue.enqueue(new MergeJobStandardSplitting<16>(inputs, numInputs, output, jobLength));
else if (numInputs <= 32)
jobQueue.enqueue(new MergeJobStandardSplitting<32>(inputs, numInputs, output, jobLength));
else if (numInputs <= 64)
jobQueue.enqueue(new MergeJobStandardSplitting<64>(inputs, numInputs, output, jobLength));
else
{
DBG(1, "Can't create job with that many streams. Add more cases.");
abort();
}
}
示例2: DBG
static inline void
parallelLcpMergeStandardSplitting(const LcpCacheStringPtr* input, unsigned numInputs, string* output, size_t length)
{
g_outputBase = output;
g_splittingsExecuted = 0;
g_mergeJobsCreated = 0;
g_splittingTime = 0;
ClockTimer timer;
timer.start();
g_outputBase = output;
JobQueue jobQueue;
DBG(debug_merge_start_message, "doing parallel lcp merge for " << numInputs << " input streams using " << omp_get_max_threads() << " threads with standard splitting");
jobQueue.enqueue(new InitialJobStandardSplitting(input, numInputs, output, length));
jobQueue.numaLoop(-1, omp_get_max_threads());
g_stats >> "toplevelmerge_time" << timer.elapsed();
g_stats >> "splittings_executed" << g_splittingsExecuted;
g_stats >> "mergejobs_created" << g_mergeJobsCreated;
g_stats >> "splitting_time" << g_splittingTime;
}