并行 C# 循环中的 'ctr' 变量是什么?

What is the 'ctr' variable in a parallel C# loop?

我最近在一个小的 C# 程序中使用了 Parallel.For 循环(见下面的代码),我对 ctr 变量有点困惑。到目前为止,我看到的每个示例都将此变量的名称设置为 ctr,但我似乎无法找到关于它的含义或为什么使用 this 名称的任何好的资源。

如果有人知道更多,我很乐意听到!

public static int[] calcArray(int[] arrName, int arrSize, int seed)
{
    Parallel.For(0, arrSize, ctr =>
   {
       arrName[ctr] = AllfunctionsClass.Random(seed);
       seed++;
   });
    return arrName;
}

当前索引值..想象一个正常的for循环

for (int ctr=0; ctr < arraySize; ctr++)
{
    // ctr is the current value between 0 and arraySize-1
}

在这种情况下选择的变量名称是任意的,可能是计数器的缩写。恕我直言,变量名称应该很少被缩写,并且应该使它们所代表的含义显而易见,例如arrayPosition 或 position 或索引或类似的东西