【发布时间】:2014-08-24 12:47:25
【问题描述】:
我的任务是使用 PLINQ 并行化迭代。为此,我有一个基于 for-cycle 的函数:
public void PointGenerator(int n, Random rnd)
{
for (int i = 1; i <= n; i++)
{
x = rnd.NextDouble();
y = rnd.NextDouble(); //
if (((x - 0.5) * (x - 0.5) + (y - 0.5) * (y - 0.5)) < 0.25)
{
N_0++;
}
}
}
我如何使用 PLINQ 来做到这一点?
【问题讨论】: