How for loop inside the fork will execute?

I am writing a two for loops inside the fork join. since whatever the statements inside fork starts at same time and execute parallelly,
if i execute the below code

module top;
  int a,b;
  initial fork
    for(int i=0;i<10;i++)
      $display("a=%d",i);
    for(int j=0;j<10;j++)
      $display("b=%d",j);
  join
endmodule

I should get display statements as

a=0
b=0
a=1
b=1

But when I execute the code I am getting the output

a=0
a=1
a=2

b=0
b=1
b=2

Why I am getting the output like this can anyone clarify this?

Thank you

In reply to Manoj J:

you are right they got executed in parallel.
But what is important to understand that both variables a & b changed their values from 0-9 in zero time.
So its just that simulator has to choose whose $display to flush first.

If you want to see the parallel execution.
You must see the change w.r.t. time.
Just small modification in your code :

module top;
  int a,b;
  initial fork
    for(int i=0;i<10;i++) 
      #10 $display("a=%d",i);
    for(int j=0;j<10;j++)
      #10 $display("b=%d",j);
  join
endmodule

will get the output as desired !

In reply to Anurag Gupta:

This has nothing to do with $display output flushing,

When you have processes executing in parallel, there is no deterministic ordering between statements executing at the same time. The output you were expecting and what you actually got are both valid possibilities. Another simulator might have picked the second for-loop to execute first. However, most single single core simulators stay on one process and only switch when there is a blocking event, or the process terminates.

Thank you dave_59 and Anurag gupta for the clarification!!