I have this code :
for (int i = 0; i < 10000; i++)
{
printValue(i);
}
private void printValue(int value)
{
Console.WriteLine(value);
}
is there any case in which the numbers printed are not in order?
I mean, maybe the thread of the method printValue(60) is executed before than printValue(50)? (just as example).
Or they are synchronized?
As far as I can see from this snippet, there is only one thread, which is sequentially executing the
printValuefunction calls. So there is no question of synchronization, because there is only one thread.