本文整理汇总了C++中tbb::blocked_range::remove_some_safe方法的典型用法代码示例。如果您正苦于以下问题:C++ blocked_range::remove_some_safe方法的具体用法?C++ blocked_range::remove_some_safe怎么用?C++ blocked_range::remove_some_safe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tbb::blocked_range
的用法示例。
在下文中一共展示了blocked_range::remove_some_safe方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator () (tbb::blocked_range<int> &range, tbb::task* parent_task) const {
//int cnt = 0;
for(int i = range.begin(); i < range.end() /*&& parent_task->bflws_pushed == false*/; i++) {
range.remove_some_safe();
list_node *node;
if (addok(head, i, column)) {
// add the node
#ifdef QUIT_ON_SOLUTION // QUIT as soon as a solution is found
if (node!=NULL && solution == NULL) {
#endif
list_node new_node;
new_node.next = head;
new_node.row = i;
if (column+1<SIZE) {
#ifdef CUTOFF
if (column+1>=CUTOFF_LEVEL)
ser_nqueens_rec(column+1, &new_node);
else
nqueens_rec(column+1, &new_node, parent_task);
#else
nqueens_rec(column+1, &new_node, parent_task);
#endif
} else { // found a solution
//solution = &new_node;
solution_count++; //atomic
//abort()
}
#ifdef QUIT_ON_SOLUTION // QUIT as soon as a solution is found
}
#endif
} // end if addok
// else do nothing -- dead computation branch
//cnt++;
//if (cnt == GRAINSIZE)) {
//cnt = 0;
//subrange = range.remove_some_safe();
DEQUE_CHECK_CODE (parent_task);
//else end = range.end();
//}
//printf("Saved one ping-pong!\n");
//std::cout << "Saved one\n" ;
//savedcnt ++;
//i++;
} // end for-loop over range
//printf("Saved %d ping-pongs\n", savedcnt);
//std::cout << "Saved " << savedcnt << "\n" ;
}