using System;
using System.Threading.Tasks;
public class Program
{
public static void Main()
var x = 0;
var myList = new[] { "hello" };
Parallel.ForEach(myList, item =>
x = 3;
});
if (x != 0)
Console.WriteLine("x is not zero");
}