我的C++非常基础,这是我第一次尝试多线程代码。 所以我的数据集相当大我认为我可以通过分离一些功能来缩短时间。在伪代码中描述的是我想要的一般概念。在C++中运行两个进程并等待它们完成
int main(){
process1();
process2();
}
process1(){
base value for recursion
Builds a forward array
Once complete - run function combination();
Recursive call
}
process2(){
base value for recursion
Builds backwards array
Once complete - run function combination();
Recursive call
}
combination(){
when both functions are complete.
if functions return null then the array is complete
else add results into a new array.
}
递归调用是我可能在这里遇到的难题。是否有一种简单的方法来实现两个流程必须完成第一次迭代才能运行组合并再次通过它的地方?
哦,这个代码希望SIMD这么难.... – iehrlich