Parallel.For
static void Main(string[] args){
int i = 0;
Parallel.For(0, 100, (x) =>
{
Console.WriteLine(i);
i++;
});
Console.WriteLine($"i is {i}");
Console.ReadLine();
}
<p><div align="center"></div></p><br><br/><br/><br/><br/><br/>来源:<a href="https://www.cnblogs.com/Fred1987/archive/2019/09/15/11521723.html" target="_blank">https://www.cnblogs.com/Fred1987/archive/2019/09/15/11521723.html</a>
页:
[1]